aboutsummaryrefslogtreecommitdiff
path: root/xwayland/xwayland.c
AgeCommit message (Collapse)Author
2024-02-15Define _POSIX_C_SOURCE globallySimon Ser
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead, require POSIX.1-2008 globally. A lot of core source files depend on that already. Some care must be taken on a few select files where we need a bit more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and some files need BSD extensions (_DEFAULT_SOURCE). In both cases, these feature test macros imply _POSIX_C_SOURCE. Make sure to not define both these macros and _POSIX_C_SOURCE explicitly to avoid POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001 but _XOPEN_SOURCE says POSIX.1-2008). Additionally, there is one special case in render/vulkan/vulkan.c. That file needs major()/minor(), and these are system-specific. On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need to make sure it's not defined for this file. On Linux, we can explicitly include <sys/sysmacros.h> and ensure that apart from symbols defined there the file only uses POSIX toys.
2023-10-10xwayland: add wlr_xwayland_create_with_server()Simon Ser
Allows compositors to set up the server (and shell) on their own.
2023-10-06xwayland: fix double free wlr_xwayland_shell_v1JiDe Zhang
2023-10-03treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practicalAlexander Orzechowski
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
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-11-18xwayland/xwm: add support for xwayland-shell-v1Simon Ser
2022-11-02xwayland: split headersSimon Ser
We're about to get one more Xwayland-related thing, and this header already contains two things.
2022-08-18Use wl_signal_emit_mutableAlexander Orzechowski
2022-05-07xwayland: terminate when no client is connectedSimon Ser
Automatically shutdown Xwayland 10s after all X11 clients have gone away.
2022-04-23xwayland: do not double free server on destroyzsugabubus
2021-09-11xwayland: Allow to retrieve startup-id via _NET_STARTUP_INFOGuido Günther
A launchee notifies with a "remove"¹ message when done starting up. Catch these and forward to the compositor. This allows the compositor to end the startup sequence that might have been started by another protocol like xdg-activation. We don't handle other messages since we expect the launcher to use a wayland protocol like xdg-activation. While `_NET_STARTUP_ID` helps to associate toplevels with startup-ids this signals the end of the startup sequence. 1) https://specifications.freedesktop.org/startup-notification-spec/startup-notification-latest.txt
2021-08-17xwayland: do not free cursor in handle_server_ready()Michele Sorcinelli
If XWayland terminates for any reason, xwm_set_cursor() has to to be called again, so the cursor has to stick around.
2021-01-17Free xwayland cursor in wlr_xwayland_destroyChris Chamberlain
One of many memory leaks detected by an asan build
2020-07-27xwayland: free server in error pathAntonin Décimo
2020-06-30xwayland: Don't discard ready signalsScott Moreau
The xwayland ready signals are used to do initial setup like starting xwm. Discarding the signals means that the handler functions will not be called in the case that Xwayland is restarted and thus, xwm managed clients fail. Fixes #2174."
2020-05-19xwayland: add option to disable WMSimon Ser
2020-05-19xwayland: split serverSimon Ser
Split the server part of wlr_xwayland into wlr_xwayland_server. This allows compositors to implement their own XWM when wlroots' isn't a good fit.
2019-12-31xwayland: Clean up if Xwayland fails to startScott Moreau
When running wlroots compositors with Xwayland executable bits unset, if DISPLAY is set to the display number wlroots has set up, then X and gtk clients (at least) hang when they are ran. X clients should fail with an error and exit while gtk clients should fall back to wayland backend and run correctly. This is because wlroots opened sockets for Xwayland but wasn't closing them if Xwayland failed to start.
2019-07-27Remove all wayland-server.h includesSimon Ser
The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration.
2019-03-06xwayland: set CLOEXEC on /dev/null FDemersion
This avoids leaking the FD to Xwayland and its children.
2019-03-04xwayland: don't set DISPLAYemersion
Let the compositor set it. This allows for multiple Xwayland instances to run at the same time. Fixes https://github.com/swaywm/wlroots/issues/1442
2019-02-20xwayland: remove remaining SOCK_CLOEXECemersion
2019-02-19xwayland: don't use SOCK_CLOEXECemersion
SOCK_CLOEXEC isn't POSIX.
2018-12-13xwayland: remove clearenv() callDominique Martinet
This has been causing troubles for some of our users and only been there for legacy reasons, we trust Xwayland just as much as your next program and weston doesn't take any such care when starting it.
2018-11-06Use _POSIX_C_SOURCE, use shm_openemersion
2018-10-28xwayland: don't fail if XDG_RUNTIME_DIR is not setemersion
We don't require it, Xwayland doesn't require it, and all X11 apps I tried don't need it.
2018-09-08Fix wlr_xwayland_destroynyorain
2018-09-03Close stdout/stderr for Xwaylandrandom human
Depending on the log verbosity, close the stdout/stderr streams.
2018-07-09util: add wlr_ prefix to log symbolsemersion
2018-05-19Remove unused argumentScott Anderson
2018-05-10Fix Xwayland cleanupVincent Vanlaer
Fixes #964
2018-05-08Make xwayland_finish* clean up wlr_xwaylandVincent Vanlaer
2018-05-07Clean up eventsVincent Vanlaer
2018-05-07Add beter handling for Xwayland failing at startupVincent Vanlaer
2018-05-06Allow xwayland to start lazilyVincent Vanlaer
Makes the xwayland startup process two phased. The first phase just initialises the X11 sockets. The second phase starts the Xwayland server itself. When starting xwayland lazily the second phase will be postponed until a client has connected to the X11 socket. Changes in behaviour: The DISPLAY environment is now set immediately after the X11 sockets are created. When the Xwayland server is killed or crashes, the sockets will not be recreated, but reused. Fixes #849: Start up Xwayland lazily
2018-04-25Don't use the wlr_ prefix for static functionsemersion
2018-04-21xwayland: preserve the PATH variable n3rdopolis
Some systems don't have xwayland in /usr/bin, but in other paths. wlroots was unable to find Xwayland binaries outside of standard locations
2018-04-08xwayland: add _NET_WM_WINDOW_TYPE_MENU supportemersion
2018-03-04xwm.h: fix guard ifdef and remove wlr_ prefix from xwm_atoms_containsDominique Martinet
2018-03-03move xwm.h out of include/wlrDominique Martinet
xwm.h was meant to be private, so move it to include/xwayland/xwm.h We had an ifdef WLR_HAS_XCB_ICCCM in xwayland.h which was easy to move to xwm, it is not safe to use the WLR_HAS_* in the public headers. I checked a few of our current users and none rely on xwm.h being public as expected (rootston, sway, hsroots)
2018-02-26add xwayland unmanaged tests to support dmenuMarkus Ongyerth
This adds `wlr_xwayland_surface_is_unamanged`, to allow compositors more fine grained control over XWayland focus. A surface that is unmanaged should not receive focus, while other windows that are just override redirect may want it (dmenu). The way unamanged is determined is taken from wlc.
2018-02-19Revert "ELF Visibility"Drew DeVault
2018-02-19Explicitly export EFL symbolsScott Anderson
2018-02-12Reformat all #include directivesemersion
2018-02-12Make wlr_signal_emit_safe privateemersion
2018-02-12Add wlr_signal_emit_safeemersion
2017-12-29wlr_xwayland: preserve end of struct on restartDominique Martinet
This is more robust than trying to recopy a few fields. Note: wlr_xwayland->events.ready now resets after each trigger, so one can hook on it again and be called when restart is ready
2017-12-29xwayland: listen to wlr_seat destroy signalDominique Martinet
2017-12-29xwayland restart: copy seat and events overDominique Martinet
This is very ugly, there must be a better way to do that (not memset it?) Meanwhile, this fixes rootston xwayland on restart