Commit Graph

60 Commits

Author SHA1 Message Date
Scott Moreau a9b1d9e838 xwayland: Clean up if Xwayland fails to start
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-12-31 08:07:16 -07:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
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-07-27 15:49:32 -04:00
emersion 8363ca8c9f
xwayland: set CLOEXEC on /dev/null FD
This avoids leaking the FD to Xwayland and its children.
2019-03-06 00:32:24 +01:00
emersion 9601019192 xwayland: don't set DISPLAY
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-03-04 12:54:06 -07:00
emersion cfe7e28416
xwayland: remove remaining SOCK_CLOEXEC 2019-02-20 17:04:00 +01:00
emersion cb0a91e45a
xwayland: don't use SOCK_CLOEXEC
SOCK_CLOEXEC isn't POSIX.
2019-02-19 16:38:45 +01:00
Dominique Martinet 384642b394 xwayland: remove clearenv() call
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-12-13 09:06:28 +09:00
emersion 2d0c5ec78e
Use _POSIX_C_SOURCE, use shm_open 2018-11-06 08:29:23 +01:00
emersion 54e78e9e26
xwayland: don't fail if XDG_RUNTIME_DIR is not set
We don't require it, Xwayland doesn't require it, and all X11 apps I tried
don't need it.
2018-10-28 22:39:57 +01:00
nyorain 195103700c Fix wlr_xwayland_destroy 2018-09-08 13:00:56 +02:00
random human 93382dc445
Close stdout/stderr for Xwayland
Depending on the log verbosity, close the stdout/stderr streams.
2018-09-03 17:33:48 +05:30
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Scott Anderson 1a3921d4d4 Remove unused argument 2018-05-19 23:39:51 +12:00
Vincent Vanlaer 72a75b3a72 Fix Xwayland cleanup
Fixes #964
2018-05-10 01:44:17 +02:00
Vincent Vanlaer 119a6cf35c Make xwayland_finish* clean up wlr_xwayland 2018-05-08 22:22:35 +02:00
Vincent Vanlaer 80586b8f6b Clean up events 2018-05-07 00:48:02 +02:00
Vincent Vanlaer 446ea3a340 Add beter handling for Xwayland failing at startup 2018-05-07 00:43:26 +02:00
Vincent Vanlaer c80bf1591e Allow xwayland to start lazily
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-05-06 23:41:25 +02:00
emersion 625a7a48dc
Don't use the wlr_ prefix for static functions 2018-04-25 23:51:00 +01:00
n3rdopolis a470f101c1
xwayland: preserve the PATH variable
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-21 19:19:25 -04:00
emersion c55ad11d96
xwayland: add _NET_WM_WINDOW_TYPE_MENU support 2018-04-08 12:02:52 -04:00
Dominique Martinet 2910972b25 xwm.h: fix guard ifdef and remove wlr_ prefix from xwm_atoms_contains 2018-03-04 11:16:18 +01:00
Dominique Martinet 7d1870c6f1 move xwm.h out of include/wlr
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-03-03 17:03:21 +01:00
Markus Ongyerth bb676013ed add xwayland unmanaged tests to support dmenu
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-26 12:02:49 +01:00
Drew DeVault 1d9be89e2d
Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
Scott Anderson 86269052eb Explicitly export EFL symbols 2018-02-19 14:26:40 +13:00
emersion c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion 36ead80cd1
Make wlr_signal_emit_safe private 2018-02-12 19:52:47 +01:00
emersion 5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
Dominique Martinet ec952931a1 wlr_xwayland: preserve end of struct on restart
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-29 20:50:50 +01:00
Dominique Martinet e0eafa0429 xwayland: listen to wlr_seat destroy signal 2017-12-29 19:00:08 +01:00
Dominique Martinet 61b91a5721 xwayland restart: copy seat and events over
This is very ugly, there must be a better way to do that (not memset it?)
Meanwhile, this fixes rootston xwayland on restart
2017-12-29 17:33:11 +01:00
emersion 6b42bfad18
Merge branch 'master' into xwm-selection 2017-12-14 23:59:04 +01:00
emersion 75ef7860bb
Merge branch 'master' into display-destroy 2017-12-14 20:29:30 +01:00
emersion 6ef0219763
Merge branch 'master' into xwm-selection 2017-12-14 11:20:38 +01:00
Tony Crisci ea4b871e16 xwm: user custom event handler 2017-12-13 17:54:19 -05:00
emersion e30b943fbd
Destroy xwayland client when possible 2017-12-08 10:58:36 +01:00
emersion b06535718d
Do not destroy wl_client in wlr_xwayland_finish 2017-12-08 01:38:45 +01:00
emersion 18eb1eee3f
Listen to display destroy in xwayland, rename wlr_egl_free 2017-12-08 00:59:37 +01:00
Tony Crisci fc17c74516 xwayland: clean up seat setting 2017-11-22 08:23:23 -05:00
Tony Crisci b0683874e9 xwm: send selection data 2017-11-22 08:10:06 -05:00
Drew DeVault a317ecdab8 Run startup command after xwayland is ready 2017-11-12 16:01:48 -05:00
emersion 3f4ad47421
Use compositor theme for xwm cursor 2017-11-02 16:49:22 +01:00
Tony Crisci 2ff94d0036 xwm: get rid of displayable surfaces list 2017-10-24 18:57:20 -04:00
Greg V a5fe9aa736 Add FreeBSD compatibility 2017-10-11 00:07:21 +03:00
Calvin Lee dd4bdf1f56 Unset $DISPLAY until XWayland is ready 2017-10-03 22:42:10 -06:00
emersion b7927078e9
x11 -> xwayland, window -> surface, fix some calloc sizes and wrong types 2017-09-28 23:26:31 +02:00
Drew DeVault 906a816abf Fix rootston keyboard, add Xwayland 2017-09-28 08:54:57 -04:00
Dominique Martinet 871646d225 Double-fork for xwayland execution
The intermediate fork needs to wait for SIGUSR1 for when Xserver is
ready, or SIGCHLD if the exec didn't work out.

Also change the exit() to _exit() as that is apparently more appropriate
for forks (and waitpid's status was wrong without it for some reason)

Fixes #122.
2017-08-27 21:41:08 +02:00
Dominique Martinet b29c7d01b1 xwayland: relinquish wl_fd[0] after creating client
wayland WILL close this fd during wl_client_destroy, after our handler
if we close it as well this will close some of the fd we reopened
2017-08-24 07:51:24 +02:00