Commit Graph

16 Commits

Author SHA1 Message Date
Simon Ser 770a561bce xwayland: embed wlr_xwayland_server_options in server struct
As more options are added, more fields will be duplicated. Let's
just embed the struct in wlr_xwayland_server so that we don't need
to keep both in sync.
2021-07-27 00:18:11 +02:00
Simon Ser 4b316a3823 xwayland: simplify argv filling logic
Remove fill_arg and replace it with stack-allocations and simple
array-filling.
2021-07-27 00:18:11 +02:00
Simon Ser d2b6b570ea xwayland: improve startup log message
Logging the raw Xwayland command-line was incomplete, uninformative
and confusing for end-users. Instead, print a proper message in
English.
2021-06-25 10:54:10 +02:00
Thomas Weißschuh 9f211b5dd4 xwayland: actually use Xwayland from pkg-config
eec2e1d3b1 introduced logic to use the Xwayland
binary discovered via pkg-config.
While the newly introduced checks correctly used the binary from pkg-config,
the actual execution still used the previous PATH-search logic.
2021-05-12 10:55:15 +02:00
Simon Ser e6f6e1ad0a xwayland: use -listenfd if available
Xwayland's -listen option was deprecated in [1] in favor of -listenfd.

[1]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/593
2021-03-03 19:04:47 +01:00
Simon Ser eec2e1d3b1 xwayland: check executable exists on init
Instead of walking PATH like a previous proposal [1], this one
checks that the Xwayland path specified in the pkg-config file
exists.

I think this is a reasonable compromise:

- Users that don't have Xwayland installed system-wide won't get
  a bogus DISPLAY env variable set up.
- Users that have WLR_XWAYLAND set won't be affected by this check.
- Users that have Xwayland installed system-wide and a different
  Xwayland in their PATH still get their custom Xwayland.
- Users that don't have Xwayland installed system-wide but have it
  somewhere else in PATH are left out. But this is pretty niche,
  and they can just set WLR_XWAYLAND.

[1]: https://github.com/swaywm/wlroots/pull/2314
2021-03-03 18:19:12 +01:00
Isaac Freund 6c08fe9796 xwayland: avoid crash on repeated server_finish_display() call
This function may end up being called more than once if the Xwayland
binary does not exist on the system.
2020-12-19 10:39:31 +01:00
Dominik Honnef 431ec52b9c xwayland: use pipe instead of SIGUSR1 to signal readiness
Closes: https://github.com/swaywm/wlroots/issues/2154
2020-12-07 12:24:56 +01:00
Simon Ser 50b5f8558e
xwayland: add -core to flags
Xwayland has its own special handling for signals like SIGSEGV/SIGABRT.
Instead of leaving the job to the OS, it tries to walk up the call stack
(badly, because a lot of information is missing), print the stack trace
to stdout, then exit(1). This is very annoying because it prevents
Xwayland crashes from being easily debugged.

Xwayland has a flag "-core" that aborts instead of exiting. This allows
the OS to generate a coredump. It's far from perfect but better than
nothing, I guess.
2020-12-02 11:49:57 +01:00
Tudor Brindus 5217456b50 xwayland: fix minor typo in debug log
This accidentally slipped through 1b0e4c7.
2020-10-20 09:09:49 +02:00
Tudor Brindus 1b0e4c7e6e xwayland: introduce WLR_XWAYLAND for specifying which Xwayland to use
When debugging Xwayland-related issues, a common first step in debugging
has been to ask the reporter to move their real Xwayland to
/usr/bin/Xwayland.bin, and create a shell script starting Xwayland with
extra arguments under the original /usr/bin/Xwayland location.

Introducing a `WLR_XWAYLAND` environment variable makes this less
invasive, by allowing the user to swap out Xwayland without resorting to
global system changes (or source patches).
2020-10-11 09:00:52 +02:00
Ilia Bozhinov 3e03f786ee xwayland: disconnect display destroy listener even if xwayland didn't initialize 2020-09-04 17:55:23 +02:00
Scott Moreau 84d2f30faa xwayland: Don't discard ready signals
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-06-30 21:21:25 +02:00
Tudor Brindus 5947160630 xwayland: add error-checking to `server_start_lazy`
This prevents a very unlikely crash in `xwayland_socket_connected`.

Refs #2163.
2020-05-27 18:39:26 +02:00
Simon Ser 2176c63856 xwayland: add option to disable WM 2020-05-19 22:07:47 +02:00
Simon Ser 27609ba0d9 xwayland: split server
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.
2020-05-19 22:07:47 +02:00