aboutsummaryrefslogtreecommitdiff
path: root/xwayland
AgeCommit message (Collapse)Author
2023-07-11Use wl_container_of() instead of castsSimon Ser
This slightly improves type safety. The culprits were found with: git grep -E '\([a-z0-9_ ]+ \*\)\W?[a-z]'
2023-07-10xwayland-shell: don't remove inert role resourceKirill Primak
2023-07-09xwayland: pass NULL as event dataSimon Ser
This is more extensible: in the future we can introduce event structs if we need to.
2023-07-09xwayland: use initializer for struct wlr_xwayland_resize_eventSimon Ser
Ensures there are no fields with uninitialized memory. Also remove an outdated TODO: Xwayland only supports a single seat.
2023-07-09xwayland: drop struct wlr_xwayland_move_eventSimon Ser
This only contains the xsurface, which isn't particularly useful.
2023-07-07Use struct initializers instead of memset()Simon Ser
This is a bit more type-safe.
2023-06-23compositor: listen to role_resource destroy signalSimon Ser
Call wlr_surface_destroy_role_object() when the role_resource is destroyed.
2023-06-23compositor: replace role_data with role_resourceSimon Ser
This increases type safety, makes it more obvious that role_data must represent the role object, and will allow for automatic cleanup when the resource is destroyed.
2023-06-23compositor: introduce wlr_surface_set_role_object()Kirill Primak
2023-06-22xwayland: unset wlr_xwayland.server on destroySimon Ser
This fixes a use-after-free in the Sway patch to filter the Xwayland shell [1]. The server is destroyed first, then the shell. The Xwayland process might still be using the shell while running. When the shell is destroyed, libwayland will invoke the global filter (to figure out whether to send a wl_registry.global_remove to clients). Then Sway will compare the client with wlr_xwayland_server.client. However, at that point, the server is gone. Reset the server to NULL so that Sway can check whether the server is still running. [1]: https://github.com/swaywm/sway/pull/7647
2023-06-05Add some missing includes/declarationsKirill Primak
2023-06-02xwm: check for a buffer before mappingKirill Primak
2023-06-02xwm: use unified map logicKirill Primak
2023-06-02xwm: introduce associate/dissociate eventsKirill Primak
We'll soon introduce a unified wlr_surface map event. Up until now, compositors have been using wlr_xwayland_surface's map event to setup various wlr_surface related listeners (e.g. commit). This will no longer be possible when that event is moved over to wlr_surface. Introduce new events where the compositor can add/remove wlr_surface event listeners.
2023-06-02Revert "xwm: emit new_surface/destroy on associate/dissociate"Kirill Primak
Firing new_surface when a wlr_surface is associated to the X11 window is too late: the X11 client might've sent configure events before that. This reverts commit 039cca8a51ed0783d45fb7a5215e9ae83e4e02e2. Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3606
2023-05-04xwayland: allow compositor to set withdrawn statenovenary
2023-05-04xwayland: enable use of a xserver subprojectSimon Ser
Makes it easier to work on Xwayland and wlroots features in parallel. References: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1048
2023-03-09xwm: emit new_surface/destroy on associate/dissociateKirill Primak
2023-03-09xwm: make atom_map staticKirill Primak
2023-03-07xwm: remove misleading commentKirill Primak
The surfaces are stored in the bottom-to-top order, as specified in include/xwayland/xwm.h and expected by wlr_xwayland_surface_restack().
2023-02-21xwayland: Send synthetic ConfigureNotify per ICCCM 4.1.5John Lindgren
X11 clients expect a ConfigureNotify after a ConfigureRequest. If the compositor/window manager chooses not to honor the request (e.g. due to the window being maximized), XWayland will not send a "real" ConfigureNotify event and the window manager is expected to send a synthetic event instead. Otherwise, the X11 client is left waiting and may not repaint its window properly. For comparison, see Openbox's client_configure() or Weston's weston_wm_window_send_configure_notify(). v2: Move logic to wlr_xwayland_surface_configure()
2023-02-13xwayland: Read and publish _NET_WM_STRUT_PARTIAL propertyJohn Lindgren
This is needed for compositors that want to reserve space for XWayland panels. Such a feature can be useful in a "transitional" setup, where only the X11 window manager and compositor is replaced but other components of an X11 desktop environment are still used. This change simply reads the X11 property; the compositor is free to ignore it. Thus, compositors that don't want to support such a "transitional" feature are not impacted. v2: Update xwayland_surface_associate()
2023-02-03xwayland/shell: actually use wlr_xwayland_surface_v1.linkKirill Primak
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3575
2023-02-01xwayland/xwm: reset serial in xwayland_surface_dissociate()Simon Ser
The same X11 window can be used multiple times with a different wl_surface. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3570
2023-02-01xwayland/xwm: introduce wlr_xwayland_surface_try_from_wlr_surface()Kirill Primak
This new function replaces wlr_surface_is_xwayland_surface() and wlr_xwayland_surface_from_wlr_surface().
2022-12-22xwayland/xwm: remove unnecessary surface_id resetSimon Ser
xwayland_surface_associate() already does this.
2022-12-22xwayland/xwm: assert that we're not overwriting when associatingSimon Ser
Make sure xwayland_surface_associate() is not called twice in a row without a xwayland_surface_dissociate() call in-between.
2022-12-22xwayland/xwm: dissociate even if surface is NULLKirill Primak
If a window is unmapped too quickly, we might receive UnmapNotify before we get the corresponding wl_surface, which will later lead to associating the same window twice. To fix this, move the NULL surface check to xwayland_surface_dissociate(), which makes resetting the unpaired link and the wl_surface object ID unconditional. Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3552
2022-12-18xwayland/xwm: constify needlesKirill Primak
2022-12-08xwayland: use HAVE_ prefix for xcb_xfixes_set_client_disconnect_modeSimon Ser
86fc2199f85a ("build: unify naming for HAVE_* defines") has switched over all other feature defines from HAS_* to HAVE_*, but missed this one.
2022-12-08xwayland: remove find_program() fallback when dep is not foundSimon Ser
The dep allows us to check dep variables to discover supported features. With the binary we assume none of the features are supported. If a user forgets to install the pkg-config file (e.g. because it's in a split package) we end up incorrectly disabling all features. Instead let's error out.
2022-12-06build: unify naming for HAVE_* definesSimon Ser
We sometimes used HAS_, sometimes polluted the LIBINPUT_ namespace, etc.
2022-12-06xwayland: use internal_configSimon Ser
Avoids the need to have a separate config.h, and removes C compiler arguments.
2022-12-05xwayland/xwm: replace role with addonSimon Ser
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3545
2022-12-05xwayland/xwm: rename xwm_map_shell_surface()Simon Ser
Rename xwm_map_shell_surface() to xwayland_surface_associate(). This function doesn't actually "map" the surface in Wayland parlance, the wl_surface may not have a buffer attached yet.
2022-11-18xwayland/xwm: add support for xwayland-shell-v1Simon Ser
2022-11-18xwayland/shell: add wlr_xwayland_shell_v1_surface_from_serial()Simon Ser
2022-11-18xwayland/server: delay non-lazy startupSimon Ser
This allows users to setup event listeners before the server is actually started.
2022-11-18xwayland/server: add start signalSimon Ser
This can be used to know when wlr_xwayland_server decides to start a new Xwayland process. At that point the wl_client has already been created but the Xwayland process hasn't been started yet.
2022-11-18xwayland: add wlr_xwayland_shell_v1_destroy()Simon Ser
2022-11-18xwayland: add wlr_xwayland_shell_v1_set_client()Simon Ser
2022-11-18xwayland-shell-v1: new protocol implementationSimon Ser
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/163
2022-11-06compositor: drop role object NULL checks in handlersKirill Primak
Instead, move the check to the caller.
2022-11-06xwayland/xwm: use role object destroy handlerKirill Primak
2022-11-02xwayland: split headersSimon Ser
We're about to get one more Xwayland-related thing, and this header already contains two things.
2022-10-19xwyland/xwm: simplify unpaired_link handlingSimon Ser
Always keep it initialized, so that we don't have to check for xsurface->surface_id. Will help with WL_SURFACE_SERIAL support, which adds a new way for a surface to be unpaired.
2022-10-18xwayland: Simplify net_wm_edges_to_wlrAlexander Orzechowski
2022-08-18Use wl_signal_emit_mutableAlexander Orzechowski
2022-08-06Set mapped before firing map/unmap eventsKenny Levinsen
This allows whatever the user calls from the signal handlers to react to observe the new state rather than the old, e.g. that a surface is no longer mapped in the unmap handler.
2022-05-23xwayland: Add support for -force-xrandr-emulationJoshua Ashton