1
0
Fork 0
Commit graph

592 commits

Author SHA1 Message Date
Bilal Elmoussaoui
3e95609073 compositor/dnd: Guard X11 types
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2445>
2023-05-15 20:36:23 +02:00
Bilal Elmoussaoui
761a254e6f core/display: Guard X11 types
This also moves a couple of function calls to
MetaDisplay::x11-display-opened a signal handler

Related https://gitlab.gnome.org/GNOME/mutter/-/issues/2272

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2445>
2023-05-15 20:36:23 +02:00
Bilal Elmoussaoui
aaa3f34cc0 compositor: Guard X11 types
This also moves meta_compositor_x11_redirect_windows to DisplayX11
where it makes more sense as meta_display_x11_redirection_windows

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2272
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2445>
2023-05-15 20:23:37 +02:00
Marco Trevisan (Treviño)
184b8e9c8c x11/x11-display: Fix some wrong code style to please CI checker
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2970>
2023-05-15 19:06:40 +02:00
Marco Trevisan (Treviño)
8039b58410 x11/x11-display: Always set the compositor manager selection on init
Set the compositor manager selection during the initialization phase as
we do with the window manager selection

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2970>
2023-05-15 19:06:37 +02:00
Marco Trevisan (Treviño)
2625edec10 x11/x11-display: Set compositor selection earlier on XWayland
When the X11 display is actually XWayland there's no point to delay the
compositor selection, given that mutter itself is the compositor and
doing this may cause the first X11 client that starts not to receive the
right information (and in some cases misbehave).

Since some toolkits are not handling the compositor selection changes
properly at later times, let's make their life easier by just
initializing the selection as early as the other X11 properties, given
that in this case there's nothing to replace.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2472
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2970>
2023-05-15 19:04:59 +02:00
Sebastian Keller
dddaf19d07 x11: Always initialize all fields of XEvents sent via XSendEvent
The X server ignores the send_event and serial in incoming XEvents, so
they were not initialized when calling XSendEvent in a few places.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2641
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2964>
2023-04-17 01:52:36 +02:00
Sebastian Keller
6fbe4286ea x11: Fix remaining leaks from switch to XGetAtomName()
After this got changed from gdk_x11_get_xatom_name() to XGetAtomName(),
this no longer returns a const char* and it now also needs to be freed.

Fixes: e66f4396e ("x11: Avoid GDK API in X11 selections")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
2023-04-14 13:27:19 +00:00
Sebastian Keller
94bd5c7319 x11: Use Atoms when constructing a new MetaX11SelectionOutputStream
This was pointlessly being converted between atom and string and back,
which with the switch from gdk_x11_get_xatom_name() to XGetAtomName()
also introduced a leak for every XGetAtomName() call.

Fixes: e66f4396e ("x11: Avoid GDK API in X11 selections")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
2023-04-14 13:27:19 +00:00
Sebastian Keller
01ae1d32ee x11: Remove unused member variables from MetaX11SelectionInputStream
The private format and type member variables were not being used by any
of the callers, so they can simply be removed. This also fixes a leak of
type which was introduced when switching from gdk_x11_get_xatom_name()
to XGetAtomName().

Fixes: e66f4396e ("x11: Avoid GDK API in X11 selections")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
2023-04-14 13:27:19 +00:00
Carlos Garnacho
a42bc34e4d core: Pass MetaWindow on passive button grab machinery
In practical effects the passed Window is always window->xwindow,
so pass the MetaWindow and get the better X11 Window deep in the
call stack.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2954>
2023-04-12 11:28:50 +02:00
Carlos Garnacho
1e459c8302 x11: Wrap X call with error traps
Lest it fails. Try to recover from that and keep reading
the mimetypes present in the atom list.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6555
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2945>
2023-04-04 18:35:11 +00:00
Carlos Garnacho
2e82702084 x11: Pass Atom directly
We convert an atom to string just to convert it to an atom. We
can avoid the roundtrip.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2945>
2023-04-04 18:35:11 +00:00
Jonas Ådahl
08bdee58c9 Revert "core: Avoid setting up frames on fullscreen windows"
This caused feedback loops with old statically compiled SDL
applications. The bug is fixed in upstream SDL, but that doesn't help
when the executables have old SDL's built into them.

This reverts commit beeeea546b.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2678
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2921>
2023-03-18 18:25:39 +00:00
Carlos Garnacho
5daddf0bc7 core: Retrieve DESKTOP_AUTOSTART_ID early on startup
With the move away from GTK3, and the indirect dependency on GTK4
grown in the GNOME Shell side, we've indirectly gotten a small sneaky
behavioral change: The GTK4 library will, right on dlopen, get
DESKTOP_AUTOSTART_ID for itself and delete it from the environment.

This happens before our own X11 session management code is
initialized, which confuses the hell out of it, into thinking
initialization is actually shutdown, gnome-session does not follow
along with this request, which leaves GNOME Shell into a confused
startup state where it never calls SmcSaveYourselfDone() and grinds
startup to a halt until gnome-session decides to move things forward.

In order to fix this, get the DESKTOP_AUTOSTART_ID before we lend
control to GNOME Shell bits and GTK4 is possibly initialized, and
feed it directly to our X11 session manager bits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2906>
2023-03-18 15:40:17 +00:00
Carlos Garnacho
608d3019b6 x11: Ignore _NET_ACTIVE_WINDOW client messages while grabbed
When a X11 application is started, typically what happens is:

- A startup notification token is created, with a _TIME%d suffix
- The application being spawned receives it through the environment
- (dbus piping, maybe)
- The application replies the startup notification token, and
  fetches the timestamp from it
- The application makes a _NET_ACTIVE_WINDOW client message request
  with this timestamp
- Mutter handles this client request and activates/focuses the window

Prevent this last step if windows are not interactable (e.g. there is
a compositor grab) and ignore the focus request. This specifically
applies to X11 clients requesting focus themselves, and unlike previous
approaches, doesn't try to prevent focus changes that do come through
interaction with Mutter/GNOME Shell.

This should only break if applications do not observe _NET_ACTIVE_WINDOW
and perform XSetInputFocus on themselves, but in that case the X11
keyboard focus is stolen from our hands already.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2878>
2023-03-05 07:17:02 +00:00
Carlos Garnacho
92792d6850 Revert "x11/events: Do not update focus XWindow during grabs"
This reverts commit 0e6395d932.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2878>
2023-03-05 07:17:02 +00:00
Carlos Garnacho
7de834b915 Revert "x11: Do not move X11 input focus during grabs"
This reverts commit a68b8e9595.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2878>
2023-03-05 07:17:02 +00:00
Olivier Fourdan
5e7754f742 x11/display: Delay cursor updates
When a client (either Wayland or X11) is started, the window activation
will update the cursor to the "busy" cursor.

Mutter will then set the X11 cursor on the X11 root window to match that
so that X11 applications which do not explicitly set a cursor inherit
from that default (busy) cursor.

Updating the X11 cursor too often can hammer the X11 connection and
cause a deadlock with Xwayland.

Reload the X11 cursor in a later handler to avoid that issue.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2849>
2023-03-04 09:07:44 +00:00
Carlos Garnacho
beeeea546b core: Avoid setting up frames on fullscreen windows
Ensure we preserve the fast zero-copy paths in Xwayland fullscreen
windows, instead of maybe rendering the client surface on top of the
frame surface, and providing the latter to the compositor.

To achieve this, additionally synchronize frame state when
recalculating features (e.g. after fullscreen/unfullscreen), and
account for this new condition when creating or destroying frames.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2797>
2023-03-03 20:33:18 +00:00
Carlos Garnacho
a4f508db57 x11: Drop all bypass_gtk checks
There's no longer a GTK to appease, we can drop these
checks to tiptoe over it the right way.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2864>
2023-03-03 20:17:01 +00:00
Carlos Garnacho
ab9ea61d3d x11: Open a X11 Display directly
Do the few remaining things that GDK is doing for us:
- Open and close the X11 Display
- Set up a GSource on the Display FD to handle events
- Allocate and free the content of XGenericEventCookie,
  to "unroll" the few XInput2 events that Mutter still
  does handle.

And remove the GdkDisplay we've so long relied on.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2864>
2023-03-03 20:17:01 +00:00
Carlos Garnacho
a5042000c6 x11: Adopt X11 error trap infrastructure from GDK
From reading the comment in the top of the file, not for the first
time. Keep our own error handler and maintain our own list of
failable x11 sequences in MetaX11Display, so we can move away from
GTK's.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2864>
2023-03-03 20:17:01 +00:00
Robert Mader
b521747d81 Remove support for window shading
It's been broken for an unknown time and was never supported on Wayland.
Thus let's remove the leftovers.

Helpful command: `rg 'shade(?!r)' --pcre2`

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2884>
2023-03-03 19:17:51 +00:00
Carlos Garnacho
53126bf008 x11: Prevent use-after-free if a filter is removed during handling
Keep a pointer to the next element, to protect against filters removing
themselves.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2640
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2868>
2023-02-24 14:11:55 +00:00
Carlos Garnacho
e0634a4060 x11: Make some unnecessarily public API private again
There's a few functions that GNOME Shell shouldn't ever need,
stop exporting them as public API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2779>
2023-02-23 17:19:22 +01:00
Carlos Garnacho
22c6374374 x11: Drop unused methods
These are not used anywhere in Mutter or GNOME Shell, it seems
we can drop them.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2779>
2023-02-23 17:19:22 +01:00
Carlos Garnacho
a799ac8ff0 x11: Add public API to handle X11 events
This API will be used by GNOME Shell to handle X11 events
in the relevant places, as a substitute to gdk_window_add_filter().

It is ATM still a bit ironic, since the Mutter X11 event handler
is itself a GdkFilterFunc, but it may move away from that eventually.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2779>
2023-02-23 17:19:22 +01:00
msizanoen1
899af9d58c window/x11: Make process_property_notify a virtual method
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2725>
2023-02-20 16:55:36 +00:00
Carlos Garnacho
81c0cf0834 x11: Avoid updating focus on wayland compositor
Reading upon the history of this code branch (commits 6891ce95dc
and 7a4c808e43 are most relevant), it seems this code is meant to
synchronize Mutter focus state taking the Xserver state as true.
That is, if Mutter tried to change the focus but something truncated
that action, Mutter focus will be changed to be in sync with the
Xserver again.

This sounds backwards in a Wayland session. Mutter focus should be
the canonical source, and not second-guessed from the current Xserver
focus window. These race conditions might still apply between X11
clients, so make these paths only apply in that case.

An example of this breaking can be reproduced with a Spotify and
Firefox window, moving the focus from the first to the second by
going to the GNOME Shell overview in between, and clicking the
Firefox window from there. The Firefox window will be raised, but
refuse to take focus.

It's unclear what made this an issue recently, perhaps commit
0e6395d932 since the now possibly ignored XI_FocusIn/Out events
affect this accounting of the Xserver focused window. Anyhow it
sounds better to ignore these paths for Wayland/native altogether.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2841>
2023-02-14 15:51:17 +00:00
Jonas Ådahl
32dc870f37 wayland: Add X11 interop service client protocol
This protocol is intended to let special clients create transient-for
relationships between X11 and Wayland windows. The client that needs
this is xdg-desktop-portal-gnome, which will create e.g. file chooser
Wayland dialogs that should be mapped on top of X11 windows.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Carlos Garnacho
a68b8e9595 x11: Do not move X11 input focus during grabs
On X11, the stage itself is backed by an XWindow, and moving the
input focus elsewhere will bypass any Clutter-level grabs.

This effectively allows newly opened windows to steal the focus
from gnome-shell itself, which is clearly undesirable. To prevent
that, only allow moving the X11 focus to a Window when no grab is
in place, just like commit 50e89e376 did for the stage focus.

But particularly the updating of x11_display->focus_xwindow is not
prevented. Since it's more consistent to the MetaDisplay/MetaX11Display
dual focus tracking and across Wayland/X11 backends, ensure the X11
input focus is actually set on the last focus Window after the
grabs are gone and windows became interactable again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2832>
2023-02-13 12:45:37 +00:00
Carlos Garnacho
e66f4396ee x11: Avoid GDK API in X11 selections
Use MetaX11Display's Display, and XInternAtom/XGetAtomName to
convert between Atoms and strings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2836>
2023-02-10 20:43:11 +00:00
Carlos Garnacho
9ff008e31b x11: Do not use buffer size on configure requests unless managed
Windows that are decorated may get configure requests before
the frames client created a corresponding frame window and Mutter
reparented the window.

Since the configure request results in the buffer size being
used to update the window size and the window does not have a
buffer yet, these requests could mistakenly result in the client
window being given a minimal size.

In these situations, do not use the buffer size but the given
size. The window still has to undergo frame creation and
reparenting before being shown for the first time.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2588
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2605
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2808>
2023-02-10 15:40:00 +00:00
Carlos Garnacho
8530e471bc x11: Avoid sloppy/mouse mode handling on Wayland
On Wayland sessions, this handling is unnecessary and even prone
to confusion (e.g. crossing serials are only ignored in X11-exclusive
paths, so this handling competes directly with that in MetaWaylandPointer).

Avoid it entirely there, so MetaWaylandPointer can figure out
sloppy/mouse mode focus for all Wayland/Xwayland surfaces.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
2023-02-09 14:38:39 +01:00
Carlos Garnacho
caf68a6563 x11: Handle accounting of ignored serials in X11 code
Move this out of MetaDisplay.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
2023-02-09 14:38:39 +01:00
Carlos Garnacho
67a69709b9 core: Make "adding ignored serials" private API
This sounds unnecessary from shell code, and possibly even harmful.
Make this API private and move it into the X11 parts where it belongs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
2023-02-09 14:38:39 +01:00
Carlos Garnacho
3356823ca2 x11: Reset ignored crossing serials from X11 code
They are only ever set and ignored from X11 code, we can also move
this bit of sloppy/mouse mode handling to the X11 parts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
2023-02-09 14:38:39 +01:00
Carlos Garnacho
b321d545b1 x11: Bypass GTK on XFixesSelectionNotify
In GTK this is only used for GTK clipboard/DnD selections, and
finding out whether there is a compositing manager in charge.
In Mutter, we manage our own clipboard/DnD selections, and don't
perform any rendering through GTK in the Mutter process.

So there's no special reason to let these events go through GTK,
and (related to xwayland-on-demand?) there may be race conditions
in the handling of the second feature.

There's a chance this race condition may be in Mutter, but it
does not sound worth to chase this race condition when we can
let GTK ignore these events. And it does not make sense to "fix"
gtk3 for this Mutter-only condition, when we intend to eventually
avoid it.

So, take the easy path and ignore these events.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2617
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2831>
2023-02-09 13:04:22 +00:00
Carlos Garnacho
d687e5634d core: Pass device/sequence on meta_window_begin_grab_op()
This is a public API change. Add device/sequence parameters to this
operation, so that window dragging and resizing can stick to one
set of pointing events of them all.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
bec8a5860a core,wayland,compositor,x11: Migrate to MetaWindowDrag
Flip the switch in using MetaWindowDrag, leaving display grab
ops and a bunch other code unused. Some places checked the grab op
and/or window in complex ways, others just checked for grab existence
and should now look for clutter ones, and others already were already
doing this in addition.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
bb9cab1491 x11: Move away from MetaEventRoute
Nowadays, there's just 2 types of it, and can be pretty much
solved with a META_GRAB_OP_NONE check.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
12773cf8e2 window: Drop frame_action argument from meta_window_begin_grab_op()
The final effect of this boolean can now be expressed through the
META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED flag to MetaGrabOp. Use that
in the relevant places, and drop the argument.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
f62200a17b core: Drop unused arguments to meta_display_grab_op()
Now that it is called from a single place, there's a few arguments
that are unnecessary:

- button and modifiers are unused
- already_grabbed was originally added to handle grab transitions between
  window menus (GtkMenus, back in the day) with display grabs. It's no
  longer necessary now
- frame_action can be passed through the META_GRAB_OP_WINDOW_FLAG UNCONSTRAINED
  flag

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
8685a706cc x11: Use meta_window_begin_grab_op() to begin window grab
Move away from meta_display_begin_grab_op().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Florian Müllner
0e6395d932 x11/events: Do not update focus XWindow during grabs
During grabs, it is expected that the X11 focus does not correspond
to the display's focus window, as focus should be on the stage's
XWindow instead.

This still messes up the keyboard focus even after we stopped moving
the X11 focus, because we end up with a presumed X11 focus window
of None, and as a result the stage is considered unfocused.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2776>
2023-01-25 13:31:49 +00:00
Florian Müllner
24f796a30c x11/display: Add some logging
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2776>
2023-01-25 13:31:49 +00:00
Carlos Garnacho
c6c7f310d8 x11: Account for variable being possibly NULL
We might end up with a NULL opaque_region here in some circumstances
(client deleted _NET_WM_OPAQUE_REGION, or passed invalid data or a
region with 0 rectangles), account for that when freeing the variable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2758>
2023-01-20 22:23:55 +00:00
Carlos Garnacho
82b2b76882 core: Add infrastructure to keep window frames' opaque regions
These frames client will use a visual with alpha information, and
report the opaque frame shapes through the _NET_WM_OPAQUE_REGION
window property. We can use this information in the Mutter side
for accurate opaque shapes, despite X11 windows with frames now
being seen as possibly transparent.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2758>
2023-01-20 22:23:55 +00:00
Carlos Garnacho
07e1f87e3b x11: Add function to know whether a client X11 window has an alpha channel
Since the windows created by the frames client will have a RGBA visual, we
no longer can perform simple tests about whether the window is opaque. For
that, we will need to additionally know whether the client-side window has
a visual with an alpha channel.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2758>
2023-01-20 22:23:55 +00:00
Carlos Garnacho
1f51dfa112 x11: Wait synchronously for the frames client to exit
This does nothing wrt making race conditions shorter in the
X11 window manager switch case, but is a nice to have in order
to ensure an orderly shutdown of X11 stuff.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2796>
2023-01-20 21:25:02 +00:00
Carlos Garnacho
5816268c1d x11: Push error trap reading X11 selection
It is a possibility that this request results in an error, so handle
the possible fallout.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2745>
2023-01-12 14:00:52 +01:00
Carlos Garnacho
8789e1b7d9 x11: Push error trap querying the _MUTTER_FRAME_FOR property
It is a possibility that this request results in an error, so handle the
possible fallout.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2745>
2023-01-12 14:00:52 +01:00
Bilal Elmoussaoui
6e818c8c38 build: Allow disabling xwayland
Mostly moving things around to allow a build without xwayland.
Note that more work might still be needed once the x11 build option
lands as that would allow us to have a proper xwayland only build
without the x server part.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2272
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2399>
2023-01-03 20:45:04 +00:00
Bilal Elmoussaoui
8b42bc77dc build: Make GTK dependency specific to X11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2407>
2022-12-22 15:13:54 +01:00
Bilal Elmoussaoui
64ee8d02f7 core: Add a in-tree copy of GtkBorder
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2407>
2022-12-22 15:13:54 +01:00
Bilal Elmoussaoui
fb4161853f cleanup: Make GDK dependency specific to X11
This way, the dependencies on GTK/GDK could be completely dropped if
built with Wayland only.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2407>
2022-12-22 15:09:03 +01:00
Jonas Ådahl
4b3cab2cca compositor: Don't make internal API public
Things like meta_compositor_destroy() and meta_compositor_add_window()
isn't intended to be used externally, and if they was, things would
probably fall apart rather quickly.

MetaCompositor also isn't introspected, meaning things that technically
belong to the compositing parts isn't easily available via some object,
but much take detours via other objects like MetaDisplay.

So move the API intended for internal usage to compositor-private.h, and
leave API that is meant to be expose in the public compositor.h.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 15:13:48 +01:00
Jonas Ådahl
3a1ded73ad x11/session: Make state tracking context aware
Instead of passing around state using GINT_TO_POINTER() pass around a
state struct that also carries a pointer to the context. This allows
avoiding using old singletons for getting a window list.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 15:13:48 +01:00
Jonas Ådahl
1b737190cc x11: Setup and user ownership chains
On the path towards clear ownership chains and always using them to find
other components, do the same for X11 client support paths too.

x11-display: Don't get backend from signleton

x11/selection: Don't get display from singleton

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 15:13:48 +01:00
Jonas Ådahl
e5908f5752 startup-notification/x11: Let the libsn user handle API annoyances
The API has no concept of user data, and requires the user to some how
get an instance without context, i.e. via static globals. Limit this to
the file where this is needed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 15:13:48 +01:00
Jonas Ådahl
2731f0cda4 wayland: Setup and use ownership chains
As elsewhere, make sure objects that need to have a ownership up to the
context, and use this ownership chain to find relevant components, such
as the backend or the Wayland compositor object instance.

wayland/data-device: Hook up data devices to seats

They are tied to a seat - make that connection in struct fields too, so
that related objects can get to the context via it.

wayland: Don't get Wayland compositor via singleton getter

This means via the ownership chain or equivalent.

xwayland: Hook up manager to Wayland compositor

Same applies to the drag-n-drop struct.

xwayland: Make X11 event handling compositor instance aware

This avoids finding it via singletons in the callee.

xwayland: Don't get Wayland compositor from singleton

xwayland: Pass manager when handling dnd event

window/xwayland: Don't get Wayland compositor from singleton

xwayland/grab-keyboard: Don't get backend from singleton

xwayland: Don't get backend from singleton

wayland: Always get the backend from the context

This means traveling up the ownership chain or equivalent when
necessary.

wayland: Hook up data devices, offers and sources to the compositor

This allows tying them to a context without going through any
singletons.

wayland: Don't get display from singleton

xwayland: Don't get display from singleton

tablet: Don't get display from singleton

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 15:13:48 +01:00
Jonas Ådahl
dd2beae6a8 core: Setup and use ownership chains
As with other parts, make objects have the ability to walk up the
ownership chain to the context, to get things like the Wayland
compositor or backend instances.

Contains these squashed commits:

display: Don't get backend from singleton

window: Don't get backend from singleton

keybindings: Don't get backend from singleton

workspace: Don't get backend from singleton

display: Don't get Wayland compositor from singleton

selection: Add display getter

context/main: Get backend directly from the context

clipboard-manager: Don't get display from singleton

stack-tracker: Don't use singleton MetaLater API

startup-notification: Hook up sequences and activations to display

This allows using context aware API directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 15:13:48 +01:00
Jonas Ådahl
26dce13c52 x11-display: Remove init GDK method from public APi
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-12-17 13:52:50 +00:00
Carlos Garnacho
5cfc626bfb x11: Drop unused function
The meta_prop_get_motif_hints() function was only used in the
old MetaUI frames code. The remaining code in mutter accesses
directly the MetaPropValue when loading properties for a window,
and does not use this API call.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2741>
2022-12-09 16:28:33 +00:00
Carlos Garnacho
66b1f43967 Revert "x11: Move Motif WM hints to a separate header"
Since we use XCB in the Mutter side, but Xlib in the frames client,
we cannot share the same struct definition since both libraries
will expect different type lengths (respectively, 32-bit ints vs.
longs).

Revert the changes that made both executables share the same
struct, since not both of them can get it right (and retrieve
correctly the struct with the contained flags) in reading the
Motif WM hints.

This reverts commit 2fb3c5a4f5.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2741>
2022-12-09 16:28:33 +00:00
Carlos Garnacho
2fb3c5a4f5 x11: Move Motif WM hints to a separate header
These are now referenced on the frames client side (in order to
track deletable state from the client window) and the mutter side
(pretty much everything else, like figuring out if a window wants
WM decorations).

It makes sense to make this a separate header, so that we don't
need to doubly define these flags/structs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2735>
2022-12-05 12:40:53 +01:00
Bram Stolk
7a103bbfe9 core: Avoid generating XEvent from uninitialized data
The uninitialized fields in this event causes use of uninitialised
data as seen in valgrind:

==71864== Syscall param writev(vector[0]) points to uninitialised byte(s)
==71864==    at 0x5026EBD: __writev (writev.c:26)
==71864==    by 0x5026EBD: writev (writev.c:24)
==71864==    by 0x6482A3B: UnknownInlinedFun (xcb_conn.c:296)
==71864==    by 0x6482A3B: _xcb_conn_wait.part.0 (xcb_conn.c:551)
==71864==    by 0x6482BAF: UnknownInlinedFun (xcb_out.c:469)
==71864==    by 0x6482BAF: _xcb_out_send (xcb_out.c:470)
==71864==    by 0x6483DD7: UnknownInlinedFun (xcb_out.c:416)
==71864==    by 0x6483DD7: xcb_writev (xcb_out.c:409)
==71864==    by 0x53B79B4: _XSend (xcb_io.c:587)
==71864==    by 0x53BBF38: _XReply (xcb_io.c:679)
==71864==    by 0x53AFFC9: XQueryTree (QuTree.c:47)
==71864==    by 0x4982A5F: query_xserver_stack (stack-tracker.c:508)
==71864==    by 0x4EA1F5F: g_closure_invoke (gclosure.c:832)
==71864==    by 0x4ECFD45: signal_emit_unlocked_R.isra.0 (gsignal.c:3796)
==71864==    by 0x4EC0129: g_signal_emit_valist (gsignal.c:3549)
==71864==    by 0x4EC03B2: g_signal_emit (gsignal.c:3606)
==71864==  Address 0x287d5900 is 32 bytes inside a block of size 16,384 alloc'd
==71864==    at 0x4849444: calloc (vg_replace_malloc.c:1340)
==71864==    by 0x53A5FE8: XOpenDisplay (OpenDis.c:240)
==71864==    by 0x6100E3C: _gdk_x11_display_open (gdkdisplay-x11.c:1565)
==71864==    by 0x60CF675: gdk_display_manager_open_display (gdkdisplaymanager.c:462)
==71864==    by 0x49D59F1: open_gdk_display (meta-x11-display.c:1041)
==71864==    by 0x49D5D64: meta_x11_display_new (meta-x11-display.c:1156)
==71864==    by 0x49564AD: meta_display_init_x11_finish (display.c:743)
==71864==    by 0x495679D: on_x11_initialized (display.c:818)
==71864==    by 0x4D67558: g_task_return_now (gtask.c:1232)
==71864==    by 0x4D67782: UnknownInlinedFun (gtask.c:1301)
==71864==    by 0x4D67782: g_task_return (gtask.c:1258)
==71864==    by 0x495663C: on_xserver_started (display.c:788)
==71864==    by 0x4D67558: g_task_return_now (gtask.c:1232)
==71864==  Uninitialised value was created by a stack allocation
==71864==    at 0x49D4A59: take_manager_selection (meta-x11-display.c:640)
==71864==

To fix this, fully initialize the event struct before sending it.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2535
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2724>
2022-12-01 20:42:36 +00:00
Carlos Garnacho
20bf7f5ceb x11: Delay next resize op after sync resize until frame is painted
Since the frames are now rendered by a separate process, we no longer
can guarantee at this point that all updates were handled. Engaging
in a new synchronous resize operation will again freeze the actor,
so sometimes we are left with a not-quite-current buffer for the
frame+window surface.

In order to ensure that the right changes made it onscreen, delay
this next synchronous resize step until the moment the surface was
repainted. This avoids those glitches, while still ensuing the
resize operation ends up in sync with the pointer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
84785951fd x11: Remove MetaX11WindowControl
These interfaces are no longer used, in favor of CSD-alike messaging
between the frames client and Mutter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
92feea3033 ui: Excise old frames UI
This is no longer used, in favor of the standalone frames client.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1077
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
f2237fa0c8 x11: Add frame synchronization to window frames
There's two meanings of "frame" there! Since SSD frames are now
rendered by an external client, and there are no actual mechanism
that ensures the frame did already get painted when the client did
respond to its NET_WM_FRAME_SYNC_REQUEST request, there may be
artifacts when resizing windows.

In order to get always the best visual result, we should actually
synchronize rendering with both the client window and the window
frame window.

This commit adds these mechanisms, so a sync alarm update is
expected on both windows until further resizes are allowed, this
ensures window and frame stay in sync, even after moving rendering
elsewhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
782d200d6c x11: Add "source_xwindow" parameter to MetaPropValue
It will become necessary to track properties and changes from frame windows,
and it will be more convenient to have this managed by the common property
tracking mechanisms.

Add this source_xwindow parameter so property handler functions can check
whether the property belonged to the client Window or the frame Window.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
a22c66fa51 x11: Add intermediate helper function to update X11 window after sync
This function will be added some more logic in future commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
6a80bc3a54 x11: Decouple sync alarms from window XIDs
Store the alarms in a different hashtable, and look up the MetaSyncCounter
right away. It so far avoids the MetaWindow middle man, but will also be
simpler when each window can possibly have more than one active alarms.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
f5cb8a73d5 x11: Fix size delta calculations
This used to be a comparison between old/new width and height, but
broke long ago.

Fixes: 6e06648f - window: Refactor all move/resize operations to be in frame rect space
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
3994297429 x11: Integrate frames client into Mutter
Replace the in-process implementation of frames with the external
frames client.

When a client window is created and managed by Mutter, Mutter will
determine whether it is a window that requires decorations and
hint the creation of a frame for it by setting the _MUTTER_NEEDS_FRAME
property on the client window.

After the frames client created a window that has the _MUTTER_FRAME_FOR
property, Mutter will proceed to reparent the client window on the
frame window, and show them as a single unit.

Rendering and event handling on the frame window will be performed by
the external client, Mutter is still responsible for everything else,
namely resizing client and frame window in synchronization, and
managing updates on the MetaWindowActor.

In order to let the frame be managed by the external client, Mutter
needs to change the way some properties are forwarded to the client
and/or frame windows. Some properties are necessary to keep propagating
to the client window only, some others need to happen on the frame
window now, and some others needs to be propagated on both so they
are synchronized about the behavior.

Also, some events that were previously totally unexpected in frame
windows are now susceptible to happen, so must be allowed now.

MetaFrame in src/core/frame.c now acts as the wrapper of foreign
windows created by the frames client, from the Mutter side. Location,
size, and lifetime are still largely in control of Mutter, some
details like visible/invisible borders are obtained from the client
instead (through the _MUTTER_FRAME_EXTENTS and _GTK_FRAME_EXTENTS
properties, respectively).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
ad02ef6f44 x11: Drop unnecessary check to ignore crossing events
This check dates all the way back to commit ac2aa5337d. At the time, the
window switcher was an actual X window, that could generate crossing events
if popped up under the pointer. Checking for this kind of crossing events
made sense back at the time in order not to break focus-follows-mouse as
it's been behaving for long.

But now, this UI is all Clutter widgetry, which in the worst case (X11
sessions, of course) it will update the stage window shape to make these
parts clickable. This happens in other places of code that do already
check for ignoring crossing events.

Underneath, this looked up for a Mutter-local GdkWindow of type
GDK_WINDOW_TEMP, only the main MetaFrames window matches those characteristics
nowadays, notably no window switcher popups. Since the remaining window is
never unmapped (until perhaps shutdown), the paths were functionally dead.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:53 +00:00
Carlos Garnacho
450be1dc95 x11: Do not fake frame extents if unmanaged window asks for _NET_FRAME_EXTENTS
If the window is not managed, it's weird that it asks for _NET_FRAME_EXTENTS,
it's even weirder that mutter replies with a frame border that would only
apply if the window were managed. Stop doing the latter, and drop the
MetaUI call that calculates borders from the theme settings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:52 +00:00
Carlos Garnacho
b891f8a52c compositor: Move frame drawn x11 management to MetaSyncCounter
This is part of the same MetaSyncCounter mechanism, so move it together
on one place.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:52 +00:00
Carlos Garnacho
740b8e8cce x11: Replace MetaWindow sync request handling with MetaSyncCounter
Put the helper to use, in order to lift MetaWindow itself from this
accounting. As a bonus, the data itself now moved to the MetaWindowX11
private struct, since this may only happen with X11 windows (or its
Xwayland subclass).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:52 +00:00
Carlos Garnacho
235a86ab41 x11: Add standalone MetaSyncCounter helper struct
This helper struct takes care of the handling of requests and alarms
in order to satisfy NET_WM_SYNC_REQUEST. It will be necessary to
decouple rendering of windows and frames in future commits, so each
window may need its own synchronization and accounting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
2022-12-01 20:10:52 +00:00
Jonas Ådahl
ecaf091eb4 x11-display: Use autoptr during construction
This simplifies error paths, as they don't need to unref.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2714>
2022-11-24 12:25:29 +00:00
Bilal Elmoussaoui
7bf07d2980 core/window: Implement GInitable
Currently, we will notify the display about a new window being created
during the constructed phase of the GObject. During this time,
property-change notifications are frozen by GObject, so we'll emit a few
::notify signals only after the window-created signal, although
the actual property change happened before that.

This caused confusion in gnome-shell code where a notify::skip-taskbar =
true emission was seen when the property already was true inside a
window-created handler before.

In order to fix that that, we notify the window creation
post-construction
of the GObject on GInitable.init vfunc

Details
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6119#note_1598983
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6119

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2703>
2022-11-22 11:29:38 +01:00
Jonas Ådahl
dec3c49e5a tests/test-client: Handle alarm event processing automatically
Instead of having users of the test client manually deal with alarm
filters, let the test client automatically add itself as filters. This
changes the MetaX11Display a bit, to handle an array of filters instead
of a single filter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2704>
2022-11-21 16:30:05 +00:00
Bilal Elmoussaoui
c3a01e4e18 core: Untangle meta_window_shared_new
The constructor used to take Wayland/X11 specific types which makes
building without Wayland/X11 not possible.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2272
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2418>
2022-11-17 11:30:56 +00:00
Sebastian Keller
184055b2bb window/x11: Ignore the _NET_WM_BYPASS_COMPOSITOR = 1 hint
We already detect all the cases that allow a window to be properly
unredirected. Using this hint to bypass some of those checks only causes
windows that can not be unredirected properly to get unredirected
regardless.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2434
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2651>
2022-10-21 12:58:07 +00:00
Jonas Ådahl
11a50fffa2 window: Throttle resize-grab updates to stage updates
With high frequency mouse devices, we would send very many configure
events per each update cycle, which had the end result that some clients
constantly re-allocating and redrawing their buffers far too often, if
they did this in direct response to xdg_toplevel configure events.

Lets throttle the interactive resize updates to stage updates, to avoid
having these clients doing the excessive buffer reallocation.

This also removes some old legacy X11 client resize throttling, that
throttled a bit arbitrarily on 25 resizes a second; it is probably
enough to throttle on stage updates for these clients.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2652>
2022-10-18 18:12:03 +00:00
Jonas Ådahl
f4645b0a37 window: Make the caller decide when to constrain
There were some magic conditions that decided when
meta_window_constrain() was to be called or not. Reasoning about and
changing these conditions were complicated, and in practice the caller
knows when constraining should be done. Lets change things by adding a
'constrain' flag to the move-resize flags that makes this clearer. This
way we can, if needed, have better control of when a window is
constrained or not without leaking that logic into the generic
to-constrain-or-not expression.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2338>
2022-10-10 18:16:51 +00:00
Sebastian Wick
b4b9a7c90f core: Move remaining default focus window handling to workspace
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2489>
2022-09-20 17:14:53 +00:00
Jonas Ådahl
6edb399b2b x11-display: Keep track ourself if we're restarting
We still set the global state, so that e.g. GNOME Shell can continue
consuming it, but it looks a bit awkward to rely on a global state
inside a single function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2619>
2022-09-19 14:46:01 +00:00
Jonas Ådahl
bde4280f48 startup-notification/x11: Fix indentation
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2619>
2022-09-19 14:46:01 +00:00
Jonas Ådahl
81cc440f47 window/x11: Minor coding style cleanup
Break up a long somewhat unreadable line.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2619>
2022-09-19 14:46:00 +00:00
Jonas Ådahl
b9c3e2b01e x11-display: Fly-by coding style fix
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2619>
2022-09-19 14:46:00 +00:00
Jonas Ådahl
b8cdc91c19 x11-display: Clean up GdkDisplay opening
It exposed unnecessary public and private API, and used a global static
variable instead of a return value, none which was necessary. Remove
both API and use a return value for communicating to the caller.

This doesn't remove a public symbol, lets do that for GNOME 44.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2619>
2022-09-19 14:46:00 +00:00
Jonas Ådahl
60b382c4e3 x11/session: Set the context as client data on connection watch
It was already assumed to be the context, but we never set it as such,
so things just crashed instead. Now when we set it up correctly,
hopefully that won't happen anymore.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2406
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2267
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5078
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2609>
2022-09-02 17:52:41 +00:00
Jonas Ådahl
24965a78da window: Make monitor from rect finder helper more clearly named
The function finds a suitable logical monitor given the window
rectangle; this wasn't all that clear from the name
"calculate_main_logical_monitor".

This is in preparation for finding a new logical monitor using things
other than the geometry of the window.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2554>
2022-08-11 11:32:42 +00:00
Michel Dänzer
23526a99c7 x11-display: Unset GDK_BACKEND environment variable
mutter needs GDK to use the x11 backend. It already calls
gdk_set_allowed_backends ("x11") for this purpose; however, if
GDK_BACKEND=wayland (or any other non-x11 backend possibly) happened to
be in the environment, GDK would fail to initialize at all. This would
result in mutter not registering as X11 window manager, and all X11
clients hanging.

Big thanks to Olivier Fourdan for figuring this out!

v2:
* Restore original value of GDK_BACKEND environment variable after
  initializing GDK.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2022283
Bug: https://bugs.debian.org/1008992
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2496>
2022-08-10 08:34:48 +00:00
Jonas Ådahl
1992aa1567 x11-display: Stop special casing barriers when iterating window table
In the past, barries were added to the window management X11 display
instance window table, and then special cased when iterating over the
list.

Since then, barriers, which are really part of the backend, has stopped
being added to the window hash table, instead being managed by the
backend. Lets clean up the left-over special casing that is no longer
needed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2442>
2022-07-26 20:27:24 +00:00
Jonas Ådahl
0debb24e12 barriers: Make barriers fully part of the backend
Prior to this commit, barriers were created with a MetaDisplay pointer,
despite being entities related and owned by the backend. In the X11
case, it was also not hooked up to the backend X11 connection, but the
clutter one, meaning for example that the logic was active (but dormant)
also for the Xwayland connection.

Fix this by moving X11 barrier management and event processing fully to
the backend. Also replace passing a display pointer with passing a
backend pointer. Keep the display pointer around for a release, but mark
it as deprecated.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2442>
2022-07-26 20:27:24 +00:00