1
0
Fork 0
Commit graph

138 commits

Author SHA1 Message Date
Olivier Fourdan
26cc51a1a5 xwayland: Do not retry the same display
Mutter listens to two display connections, one for regular X11 clients
and another one for the so called "managed services".

Once an available display number is found for the regular X11 clients,
mutter would then redo the work to find another available display number
for the managed services.

Yet, it does so starting from the same initial display, which is a waste
of time since it just tried all displays to find the first available
one, so all these, including the regular display it just took, are now
in use.

So instead of starting over from the beginning when looking for a
display available for the managed services, continue from the next
display immediately after the one we found precedently.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1680>
2021-01-21 18:08:48 +01:00
Olivier Fourdan
eb06d9e165 xwayland: Do not rely on X-lock files
Some X11 servers may not always create a lock file, yet mutter uses the
lock file to find a possible display number and then tries to bind to
the socket corresponding to that display number.

If it fails to bind, it will simply bail out. As a result, if an X11
server is already listening on that display but hadn't created a lock
file, mutter won't be able to start Xwayland.

To avoid that possible issue, make mutter retry with another display
for a given number of tries when binding fails even though the display
was supposed to be available based on the lock file presence.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1604
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1669>
2021-01-21 12:57:07 +01:00
Olivier Fourdan
f6b4665b02 xwayland: Check for X11 unix directory only once
The function choose_xdisplay() calls open_display_sockets() which calls
ensure_x11_unix_dir().

We don't need to do that from within the loop though, as the directory
/tmp/.X11-unix is the same regardless of the display number.

Move the call to ensure_x11_unix_dir() from open_display_sockets() to
choose_xdisplay() prior to enter the display loop.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1669>
2021-01-21 08:48:39 +01:00
Olivier Fourdan
1bd42e8779 xwayland: Propagate error if display sockets failed
In case of failure to open the display sockets, we would not propagatre
the error which can cause a crash when trying to show the error message.

Properly propagate the error to avoid the crash.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1669>
2021-01-21 08:48:39 +01:00
James Henstridge
063db30c50 xwayland: Start Xwayland on connection to either public X11 socket
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1454
(cherry picked from commit 7b2815077fa1053069e00c0a21b2c3038f4b0d1c)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1669>
2021-01-21 08:48:39 +01:00
James Henstridge
df4b6d4ca5 Revert "wayland: Drop Xwayland abstract socket"
This reverts commit e2123768f6.  Various
container/chroot (e.g. Snaps, pressure-vessel) systems still depend on
the presence of the abstract X11 socket.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1613
(cherry picked from commit ea2192c4899ac7897efca31e8e85c157895950ac)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1669>
2021-01-21 08:48:39 +01:00
Carlos Garnacho
5671888775 wayland: Handle forced Xwayland shutdown elegantly
In the shutdown paths we check with the X11 display whether there's
remaining clients. However this happens in paths that happen after
the MetaX11Display vanished in the case of Xwayland crash.

Since in that situation the clients are forcibly vanishing too,
skip the client check.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1677>
2021-01-20 16:55:08 +01:00
Olivier Fourdan
3fc603edd3 xwayland: Make autoclose-xwayland an exp. feature
Closing automatically Xwayland once all relevant X11 clients are gone is
inherently racy, if a new client comes along right at the time we're
killing Xwayland.

Fixing the possible race conditions between mutter, Xwayland and the X11
clients may take some time.

Meanwhile, make that an experimental feature "autoclose-xwayland".

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1673>
2021-01-19 09:33:33 +01:00
Olivier Fourdan
e5347af000 xwayland: Check X11 clients prior to terminate Xwayland
Currently, mutter checks for the presence of X11 windows to decide
whether or not Xwayland can be terminated, when Xwayland is started on
demand.

Unfortunately, not all X11 clients will map a window all the time, an
X11 client may keep the X11 connection opened after closing all its
windows. In that case, we may terminate Xwayland while there are some
X11 client connected still, and terminating Xwayland will also kill
those X11 clients.

To avoid that issue, check the X11 clients actually connected using the
XRes extension. The XRes extension provides the PID of the (local) X11
clients connected to the Xserver, so we need to match that against the
actual executable names, and compare with a list of known executables
that we can safely ignore, such as ibus-x11 or gsd-xsettings.

We also check against our own executable name, considering that the X11
window manager is also an X11 client connected to the Xserver.

Also, XRes returning the PID of local clients only is not a problem
considering that Xwayland does not listen to remote connections.
However, if the user spawns a client remotely on another system using
ssh tunneling (ssh -X), only clients which actually map a window will
be accounted for.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1537
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1671>
2021-01-18 17:52:22 +01:00
Aleksandr Mezin
4f544b6362 xwayland: Set xrandr primary output
To find XWayland output that should be the primary one, iterate through all
XWayland outputs, and compare their geometry to the geometry of the primary
logical monitor.

To avoid possible race conditions (Mutter's monitor configuration already
updated, but Xrandr not yet), set the output both after Randr notifications and
after 'monitors-changed' signal.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1407

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1558>
2020-12-11 13:44:45 +00:00
Jonas Ådahl
357f3250cb xwayland: Make sure /tmp/.X11-unix/ exists
When we're running under a polyinstantiated SELinux environment, we'll
likely start with an isolated and empty /tmp, meannig no /tmp/.X11-unix
directory to add things to. To make it possible to still function in
this kind of setup, make sure said directory exists.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1626>
2020-12-10 17:10:32 +01:00
Jonas Ådahl
d940911478 xwayland: Don't spew warnings when looking for X11 displays
It's not important, so only show it when doing MUTTER_DEBUG=wayland.
Instead report what display numbers were eventually found.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1625>
2020-12-10 15:00:53 +00:00
Jonas Ådahl
4ef34ed68f xwayland: Clean up error reporting
Instead of g_warning() everywhere, use GError.

This also removes the already unused 'fatal' boolean that was still
passed around.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1625>
2020-12-10 15:00:53 +00:00
Olivier Fourdan
79d4d7a4ff xwayland: Fix XIOErrorExitHandler warning
The XIOErrorExitHandler expects (Display *, void *) whereas mutter uses
(Display *, MetaX11Display *).

That causes a warning at build time:

  warning: passing argument 2 of ‘XSetIOErrorExitHandler’ from
           incompatible pointer type [-Wincompatible-pointer-types]
    813 |   XSetIOErrorExitHandler (xdisplay, x_io_error_exit, display);

Actually, the MetaX11Display is not even used, so we can just use the
expected API and ignore the value.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1621>
2020-12-03 13:58:08 +00:00
Carlos Garnacho
f4a1dcfc93 wayland: Set IO error exit handler
If this call is available, we can turn libX11 IO errors (fatal by definition)
into something we can recover from. Try to dispose all X11 resources and close
the display instead, so the compositor can survive the event.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1447
2020-10-21 18:57:13 +02:00
Jonas Ådahl
2c95e08998 Remove misplaced line break in g_* logging functions
They resulted in empty lines in the log.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
2020-10-08 16:38:41 +02:00
Carlos Garnacho
e2123768f6 wayland: Drop Xwayland abstract socket
This is unnecessary, and even counter productive with flatpak applications,
as there is a bind mount between the application and the socket.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1289

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1424
2020-08-31 19:46:27 +00:00
Olivier Fourdan
5171e35a97 xwayland: Add a setting to disable selected X extensions
The X server, including Xwayland, can be compiled with different X11
extensions enabled at build time.

When an X11 extension is built in the X server, it's usually also
enabled at run time. Users can chose to disable those extensions at run
time using the X server command line option "-extension".

However, in the case of Xwayland, it is spawned automatically by the
Wayland compositor, and the command line options are not configurable
by users.

Add a new setting to disable a selected set of X extension in Xwayland
at startup, without needing to rebuild Xwayland.

Of course, if Xwayland is not built with a given extension support in
the first place (which is the default for the security extension for
example), that option has no effect.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1405
2020-08-29 12:20:26 +02:00
Jonas Dreßler
dac09a8e23 window: Use client PID for meta_window_get_pid()
The shell uses the PID of windows to map them to apps or to find out
which window/app triggered a dialog. It currently fails to do that in
some situations on Wayland, because meta_window_get_pid() only returns a
valid PID for x11 clients.

So use the client PID instead of the X11-exclusive _NET_WM_PID property
to find out the PID of the process that started the window. We can do
that by simply renaming the already existing
meta_window_get_client_pid() API to meta_window_get_pid() and moving
the old API providing the _NET_WM_PID to meta_window_get_netwm_pid().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1180
2020-05-21 23:10:23 +00:00
Carlos Garnacho
166a464515 wayland: Set up initialization X11 socket
This is used by GDK and the X11 bits, but may also be used for
other initialization services we might need to run along with
Xwayland initialization.

However, as the -initfd argument in Xwayland is a fairly new
feature, add some meson build-time checks so that the feature
is handled transparently while allowing to explicitly set/unset
it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/945
2020-02-29 20:41:26 +00:00
Carlos Garnacho
25c9e66c73 xwayland: Do not block on Xwayland initialization
We artificially made Xwayland initialization synchronous, as we used
to rely on MetaX11Display and other bits during meta_display_open().
With support for Xwayland on demand and --no-x11, this is certainly
not the case.

So drop the main loop surrounding Xwayland initialization, and turn
it into an async operation called from meta_display_init_x11(). This
function is turned then into the high-level entry point that will
get you from no X server to having a MetaX11Display.

The role of meta_init() in Xwayland initialization is thus reduced
to setting up the sockets. Notably no processes are spawned from here,
deferring that till there is a MetaDisplay to poke.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Carlos Garnacho
649911b6b3 core: Make meta_display_init_x11() an async function
This ATM completes the task right away, but we will want to do
further things here that are asynchronous in nature, so prepare
for this operation being async.

Since the X11 backend doesn't really need this, make it go on
the fast lane and open the MetaX11Display right away, the case
of mandatory Xwayland on a wayland session is now handled
separately.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Jonas Ådahl
f21595687f xwayland: Move out surface role related logic
Does some needed naming cleanup while at it, to be more similar to other
role types.

In short, MetaWaylandSurfaceRoleXwayland was changed to
MetaXwaylandSurface.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/835
2020-02-19 22:34:28 +00:00
Jonas Ådahl
4fccc903b5 xwayland: Don't queue frame callbacks when role assigned
'xwayland: Do not queue frame callbacks unconditionally' changed the
frame callback behavior of Xwayland surfaces so that they behave the
same way as other actor surfaces (e.g. xdg-shell ones), except for the
case when they are initially assigned.

Remove this special casing as well including the now incorrect comment,
so that the Xwayland surfaces behave the same as the others in this
regard also when assigning.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/964
2019-12-10 09:15:49 +00:00
Robert Mader
96e1883361 xwayland: Do not queue frame callbacks unconditionally
The removed comment is not longer true: XWayland schedules its VSYNC
from frame callbacks nowadays. Only sending callbacks when the surface
actor is unobscured makes XWayland throttle its VSYNC to 1/sec,
reducing repaints in many cases.

Follow up of https://gitlab.gnome.org/GNOME/mutter/merge_requests/918

https://gitlab.gnome.org/GNOME/mutter/merge_requests/956
2019-12-04 18:59:24 +01:00
Robert Mader
8e172aeecb cleanup: Use g_clear_handle_id() for g_source_remove()
It makes sure we do not forget to zero the id and lets us avoid
zero checks before. We use it for all new code, lets clean up the
existing code base.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/947
2019-11-22 01:27:40 +01:00
Jonas Ådahl
b5f50028f2 wayland: Untie MetaWindowXwayland lifetime from the wl_surface
For the most part, a MetaWindow is expected to live roughly as long as
the associated wl_surface, give or take asynchronous API discrepancies.

The exception to this rule is handling of reparenting when decorating or
undecorating a window, when a MetaWindow on X11 is made to survive the
unmap/map cycle. The fact that this didn't hold on Wayland caused
various issues, such as a feedback loop where the X11 window kept being
remapped. By making the MetaWindow lifetime for Xwayland windows being
the same as they are on plain X11, we remove the different semantics
here, which seem to lower the risk of hitting the race condition causing
the feedback loop mentioned above.

What this commit do is separate MetaWindow lifetime handling between
native Wayland windows and Xwayland windows. Wayland windows are handled
just as they were, i.e. unmanaged together as part of the wl_surface
destruction; while during the Xwayland wl_surface destruction, the
MetaWindow <-> MetaWaylandSurface association is simply broken.

Related: https://gitlab.freedesktop.org/xorg/xserver/issues/740
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/762

https://gitlab.gnome.org/GNOME/mutter/merge_requests/774
2019-10-07 20:25:20 +00:00
Robert Mader
bba8f6c53e wayland/actor-surface: Turn get_geometry_scale() into a vfunc
This allows us to implement more sophisticated logic for the different
cases. For DnD surfaces, use the geometry scale of the monitor where
the pointer is, instead of incorrectly assuming '1' as it was before.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/780
2019-09-27 15:48:36 +00:00
Olivier Fourdan
eac227a203 xwayland: Add local user to xhost
With the addition of xauth support (commit a8984a81c), Xwayland would
rely only on the provided cookies for authentication.

As a result, running an Xclient from another VT (hence without the
XAUTHORITY environment variable set) would result in an access denied.

The same on X11 is granted because the local user is automatically
granted access to Xserver by the startup scripts.

Add the local user to xhost at startup on Xwayland so that the user can
still run a client by setting the DISPLAY as long as it's the same user
on the same host.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/735
2019-08-19 17:14:40 +02:00
Olivier Fourdan
bc166aa6b4 xwayland: Use given X11 display for DnD setup
Use the provided X11 display instead of poking into GDK to get the X11
display.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/735
2019-08-19 17:14:40 +02:00
Olivier Fourdan
5fa8b24b2b xwayland: pass the X11 display
Pass the X11 display to `meta_xwayland_complete_init()` so that it can
be used without poking into GDK.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/735
2019-08-19 17:14:40 +02:00
Carlos Garnacho
3259c7e150 wayland: Start up the grace Xwayland period right after starting Xwayland
There may be cases where a X11 client does not spawn any X11 windows (eg.
simple clients like xinput --list, or xlsclients), in this case the Xwayland
server would remain running until X11 windows happen to come and go in the
future.

Firing the shutdown timeout on restart caters for this, and would be undone
if the client maps X11 windows.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/728
2019-08-15 15:09:49 +02:00
Carlos Garnacho
e9e28baab7 wayland: Create XAuthority file once
Where the prepare_auth_file() call is, it does create a new one on every
respawn of Xwayland. This is not benefitial, as the XAUTHORITY envvar is
already fixed in the session.

Only create the XAuthority file once, and reuse it on future Xwayland
respawns.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/728
2019-08-15 15:09:38 +02:00
Carlos Garnacho
80c8a287ee wayland: Check the xwayland shutdown policy before listening for x11 windows
We only listen for those so we know there's no more X11 clients that we
should keep the Xwayland server alive for. Check first that we really did
request Xwayland to be handled on demand for this, otherwise the check is
superfluous, even harmful.

https://gitlab.gnome.org/GNOME/mutter/issues/719
2019-08-07 18:34:10 +02:00
Carlos Garnacho
141373f0ba wayland: Implement on-demand start of Xwayland
The Xwayland manager now has 4 distinct phases:
- Init and shutdown (Happening together with the compositor itself)
- Start and stop

In these last 2 phases, handle orderly initialization and shutdown
of Xwayland. On initialization We will simply find out what is a
proper display name, and set up the envvar and socket so that clients
think there is a X server.

Whenever we detect data on this socket, we enter the start phase
that will launch Xwayland, and plunge the socket directly to it.
In this phase we now also set up the MetaX11Display.

The stop phase is pretty much the opposite, we will shutdown the
MetaX11Display and all related data, terminate the Xwayland
process, and restore the listening sockets. This phase happens
on a timeout whenever the last known X11 MetaWindow is gone. If no
new X clients come back in this timeout, the X server will be
eventually terminated.

The shutdown phase happens on compositor shutdown and is completely
uninteresting. Some bits there moved into the stop phase as might
happen over and over.

This is all controlled by META_DISPLAY_POLICY_ON_DEMAND and
the "autostart-xwayland" experimental setting.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/709
2019-08-06 00:41:36 +00:00
Carlos Garnacho
e8949292c1 wayland: Refactor code setting up the display socket
So it may be reused when we need to open those again.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/709
2019-08-06 00:41:36 +00:00
Carlos Garnacho
f5a2694eba wayland: Add tracking of X11 windows
This is unused ATM, but will be used to check whether it is safe to
shut Xwayland down.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/709
2019-08-06 00:41:36 +00:00
Carlos Garnacho
9a10b8ff94 wayland: Disconnect signal when the display closes
It would be potentially left dangling if the display were closed, and
reconnected again when restarting the server.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/709
2019-08-06 00:41:36 +00:00
Carlos Garnacho
8b62f4884d wayland: Rename xwayland init/shutdown functions
The start/stop verbs will be reused later when we can start and
stop the X server. Rename these functions to init/shutdown, and
init_xserver() to start_xserver().

https://gitlab.gnome.org/GNOME/mutter/merge_requests/709
2019-08-06 00:41:36 +00:00
Jonas Ådahl
f2f4af0d50 window-actor: Make it clearer that the surface actor doesn't change
The way code was structured made it easy to misunderstand things as the
surface actor of a window actor could change over time. So is not the
case, however, the intention of the corresponding "update" function was
so that a surface actor could be assigned to a window actor as soon as
the X11 window was associated with its corresponding wl_surface, if the
window in question came from Xwayland.

Restructure the code and internal API a bit to make it clear that a
window actor only once gets a surface actor assigned to it, and that it
after that point never changes.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/659
2019-06-28 21:08:23 +02:00
Ting-Wei Lan
c35e56196a xwayland: Use g_get_host_name instead of gethostname
Since the xauth file is never going to be changed after it is generated,
it is safe to use g_get_host_name here.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/626
https://gitlab.gnome.org/GNOME/mutter/merge_requests/638
2019-06-24 09:35:02 +00:00
Olivier Fourdan
c63d0173b5 xwayland: Fix build without <sys/random.h>
The include <sys/random.h> was added to glibc-2.25, previously was
<linux/random.h>.

Adjust meson build and code to accomodate both.

Fixes: a8984a81c "xwayland: Generate a Xauth file and pass this to
                  Xwayland when starting it"

https://gitlab.gnome.org/GNOME/mutter/merge_requests/633
2019-06-20 12:37:18 +02:00
Hans de Goede
a8984a81c2 xwayland: Generate a Xauth file and pass this to Xwayland when starting it
Before this commit, sudo x11-app, e.g. sudo gvim /etc/some-file, fails
when running a Wayland session. Where as doing this under a "GNOME on Xorg"
session works fine. For a user switching from the Xorg session to the
Wayland session, this is regression, which we want to avoid.

This commit fixes this by creating and passing an xauth file to Xwayland when
mutter starts it. Just like gdm or startx pass a xauth file to Xorg when they
start Xorg.

Fixes #643

https://gitlab.gnome.org/GNOME/mutter/issues/643
2019-06-20 10:16:21 +02:00
Carlos Garnacho
b1ea768949 wayland: Drop -terminate argument to Xwayland
This argument instructs Xwayland to exit when there are no further
client connections. However we eventually want to handle restarts
ourselves (where, notably, mutter's will be at least the last client
connection).

This behavior could also induce race conditions on startup with clients
that quickly open and close a display, which is a more pressing issue.

Also, add -noreset back (which was also removed in commit 054c25f693 that
added -terminate). We don't want to reset the X server to a pristine state
in that situation either.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
2019-05-24 15:30:31 +00:00
Carlos Garnacho
430f354cd9 wayland: Split Xwayland initialization in 2 steps
It is now separated into meta_xwayland_start(), which picks an unused
display and sets up the sockets, and meta_xwayland_init_xserver(), which
does the actual exec of Xwayland and MetaX11Display initialization.

This differentiation will be useful when Mutter is able to launch Xwayland
lazily, currently the former calls into the latter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
2019-05-24 15:30:31 +00:00
Robert Mader
7e2a0ede16 wayland: Move check for present window out of the actor-surface class
All child classes of `MetaWaylandShellSurface` as well as
`MetaWaylandSurfaceRoleXWayland` should only sync their actor if
their toplevel surface has a window. Currently this check is done
in the actor-surface class, but not all surface classes have a
toplevel window, e.g. dnd-surfaces.
Move the check to the right places.

For subsurfaces this assumes that the subsurface is not the child of
a window-less surface (like, as stated above, e.g. a dnd-surface).
If we want to support subsurfaces of window-less surfaces in the future
we have to extend the check here.
But as this is not a regression, ignore this case for now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/537
2019-05-09 09:06:52 +00:00
Carlos Garnacho
17d00d49d4 wayland: Reduce MetaXWaylandSelection to just DnD
All the actual selection management functionality is superseded by
MetaSelection. Reduce it to just handling the XDND messaging and leave
selections to MetaSelection.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/320
2019-05-02 16:31:45 +02:00
Niels De Graef
1c6ea5d1db Use a consistent style for enum braces
https://gitlab.gnome.org/GNOME/mutter/merge_requests/361
2019-02-28 09:31:01 +01:00
Carlos Garnacho
8a9a78ec8a wayland: Check whether Xwayland window had a prior surface in generic code
Since commit 8df2a1452c (As pointed out by Robert Mader) we just happened
do this check when doing the first lookup for a Wayland surface for a
XWayland window, when we are later notifying upon surface creation we just
set the relation with no further checks.

The cases pointed out in the comment (eg. window changing decoration) might
presumably happen in a quick enough sequence that we have two scheduled
associations on the fly, so move this check to the more generic
meta_xwayland_associate_window_with_surface() which is called on both
immediate and delayed paths.

https://gitlab.gnome.org/GNOME/mutter/issues/361
2019-02-25 17:53:52 +00:00
Jonas Ådahl
0a178a01b3 xwayland: Invert running-as-gdm check
It was accidentally inverted previously. Lets change it back.
2018-11-22 17:37:32 +00:00