environment: BUILD_SUBMITTER: dalligi CI: "true" CI_API_GRAPHQL_URL: https://gitlab.freedesktop.org/api/graphql CI_API_V4_URL: https://gitlab.freedesktop.org/api/v4 CI_COMMIT_AUTHOR: John Lindgren CI_COMMIT_BEFORE_SHA: ecb58d799c7c774832704c830be17decd5215b23 CI_COMMIT_BRANCH: offer-focus-for-merge CI_COMMIT_DESCRIPTION: |4- In labwc, we have had trouble with XWayland windows using the Globally Active input model (see wlr_xwayland_icccm_input_model()). Under traditional X11, these windows do not expect to be given focus directly by the window manager; rather, the WM sends them a WM_TAKE_FOCUS message prompting the client to take focus voluntarily. Currently, these clients are difficult to support with wlroots, because wlr_xwayland_surface_activate() assumes the client window will always accept the keyboard focus after being sent WM_TAKE_FOCUS. Some Globally Active client windows (e.g. panels/toolbars) don't want to be focused. It's useless at best to focus them, and might even make them misbehave. Others do need keyboard focus to be functional -- and there doesn't seem to be any reliable way to know this in advance. Adding wlr_xwayland_surface_offer_focus() allows the compositor to send WM_TAKE_FOCUS to a client window supporting it and then see whether the client accepts or ignores the offer. If it accepts, the surface will emit a focus_in signal notifying the compositor that it has received focus. The compositor should then call wlr_xwayland_surface_activate(). This is entirely opt-in. A compositor that doesn't want to use the new function can continue to call wlr_xwayland_surface_activate() directly just as before, and need not make any use of the new focus_in signal. The new focus_in signal might also be useful on its own, for the case where focus is allowed to move between windows belonging to the same PID. The compositor could then give a visual indication (e.g. titlebar color) of the spontaneous focus change. CI_COMMIT_MESSAGE: | xwayland: add wlr_xwayland_surface_offer_focus() In labwc, we have had trouble with XWayland windows using the Globally Active input model (see wlr_xwayland_icccm_input_model()). Under traditional X11, these windows do not expect to be given focus directly by the window manager; rather, the WM sends them a WM_TAKE_FOCUS message prompting the client to take focus voluntarily. Currently, these clients are difficult to support with wlroots, because wlr_xwayland_surface_activate() assumes the client window will always accept the keyboard focus after being sent WM_TAKE_FOCUS. Some Globally Active client windows (e.g. panels/toolbars) don't want to be focused. It's useless at best to focus them, and might even make them misbehave. Others do need keyboard focus to be functional -- and there doesn't seem to be any reliable way to know this in advance. Adding wlr_xwayland_surface_offer_focus() allows the compositor to send WM_TAKE_FOCUS to a client window supporting it and then see whether the client accepts or ignores the offer. If it accepts, the surface will emit a focus_in signal notifying the compositor that it has received focus. The compositor should then call wlr_xwayland_surface_activate(). This is entirely opt-in. A compositor that doesn't want to use the new function can continue to call wlr_xwayland_surface_activate() directly just as before, and need not make any use of the new focus_in signal. The new focus_in signal might also be useful on its own, for the case where focus is allowed to move between windows belonging to the same PID. The compositor could then give a visual indication (e.g. titlebar color) of the spontaneous focus change. CI_COMMIT_REF_NAME: offer-focus-for-merge CI_COMMIT_REF_PROTECTED: "false" CI_COMMIT_REF_SLUG: offer-focus-for-merge CI_COMMIT_SHA: 4552ce4ba3d61cb76ad5093eb631383a97ccc06d CI_COMMIT_SHORT_SHA: 4552ce4b CI_COMMIT_TIMESTAMP: "2023-10-10T02:41:27+00:00" CI_COMMIT_TITLE: 'xwayland: add wlr_xwayland_surface_offer_focus()' CI_CONFIG_PATH: .gitlab-ci.yml CI_DEFAULT_BRANCH: master CI_JOB_ID: "50091119" CI_JOB_NAME: alpine CI_JOB_NAME_SLUG: alpine CI_JOB_STAGE: test CI_JOB_STARTED_AT: "2023-10-10T02:41:35Z" CI_JOB_URL: https://gitlab.freedesktop.org/jlindgren90/wlroots/-/jobs/50091119 CI_NODE_TOTAL: "1" CI_OPEN_MERGE_REQUESTS: wlroots/wlroots!4384 CI_PAGES_DOMAIN: pages.freedesktop.org CI_PAGES_URL: https://jlindgren90.pages.freedesktop.org/wlroots CI_PIPELINE_CREATED_AT: "2023-10-10T02:41:28Z" CI_PIPELINE_ID: "1006245" CI_PIPELINE_IID: "35" CI_PIPELINE_NAME: "" CI_PIPELINE_SOURCE: push CI_PIPELINE_URL: https://gitlab.freedesktop.org/jlindgren90/wlroots/-/pipelines/1006245 CI_PROJECT_CLASSIFICATION_LABEL: "" CI_PROJECT_DESCRIPTION: A modular Wayland compositor library CI_PROJECT_ID: "12574" CI_PROJECT_NAME: wlroots CI_PROJECT_NAMESPACE: jlindgren90 CI_PROJECT_NAMESPACE_ID: "22390" CI_PROJECT_PATH: jlindgren90/wlroots CI_PROJECT_PATH_SLUG: jlindgren90-wlroots CI_PROJECT_REPOSITORY_LANGUAGES: c,meson,makefile,glsl,shell CI_PROJECT_ROOT_NAMESPACE: jlindgren90 CI_PROJECT_TITLE: wlroots CI_PROJECT_URL: https://gitlab.freedesktop.org/jlindgren90/wlroots CI_PROJECT_VISIBILITY: public CI_REGISTRY: registry.freedesktop.org CI_REGISTRY_USER: gitlab-ci-token CI_RUNNER_DESCRIPTION: dalligi SourceHut bridge CI_RUNNER_ID: "2241" CI_RUNNER_TAGS: '["dalligi"]' CI_SERVER_HOST: gitlab.freedesktop.org CI_SERVER_NAME: GitLab CI_SERVER_PORT: "443" CI_SERVER_PROTOCOL: https CI_SERVER_REVISION: e6801ed8d44 CI_SERVER_SHELL_SSH_HOST: gitlab.freedesktop.org CI_SERVER_SHELL_SSH_PORT: "22" CI_SERVER_URL: https://gitlab.freedesktop.org CI_SERVER_VERSION: 16.4.1 CI_SERVER_VERSION_MAJOR: "16" CI_SERVER_VERSION_MINOR: "4" CI_SERVER_VERSION_PATCH: "1" CI_TEMPLATE_REGISTRY_HOST: registry.gitlab.com GITLAB_CI: "true" GITLAB_FEATURES: "" GITLAB_USER_EMAIL: john@jlindgren.net GITLAB_USER_ID: "21949" GITLAB_USER_LOGIN: jlindgren90 GITLAB_USER_NAME: John Lindgren image: alpine/edge packages: - eudev-dev - ffmpeg-dev - glslang - libdisplay-info-dev - libinput-dev - libliftoff-dev - libxkbcommon-dev - mesa-dev - meson - pixman-dev - vulkan-headers - vulkan-loader-dev - wayland-dev - wayland-protocols - xcb-util-image-dev - xcb-util-renderutil-dev - xcb-util-wm-dev - xwayland-dev - libseat-dev - hwdata-dev sources: - https://gitlab-ci-token:64_drws4BJohi9xj3eyTTYZ@gitlab.freedesktop.org/jlindgren90/wlroots.git#4552ce4ba3d61cb76ad5093eb631383a97ccc06d tasks: - setup: | cd wlroots meson setup build --fatal-meson-warnings --default-library=both -Dauto_features=enabled -Dxcb-errors=disabled - build: | cd wlroots ninja -C build sudo ninja -C build install - build-features-disabled: | cd wlroots meson build --reconfigure -Dauto_features=disabled ninja -C build - tinywl: | cd wlroots/tinywl make