1
0
Fork 0
Commit graph

29830 commits

Author SHA1 Message Date
Aurimas Černius
6c9fdd56c2 Update Lithuanian translation 2023-02-13 20:54:38 +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
Jonas Ådahl
5d001a38b5 wayland: Don't set X11 envvars when we don't support X11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
f5176101cd window: Recalculate attachedness for Wayland window parent changes
When modal dialogs are attached, and we set the parent/transient-for
after setting the modal type, the attachedness isn't updated. This is
(apparently) not the case for X11 windows, as they go through a
unmanage/manage dance avoiding the issue.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
d870b08580 window: Simplify transient_for assignment
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
1b75a62030 wayland/surface: Add getter for MetaWaylandCompositor
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
1282f4668f tests/test-client: Add helper to run 'script'
The script is a list of newline separated command lines that are sent to
the client one by one as if one would have used e.g.
meta_test_client_do().

It doesn't have error handling as it's expected to be used from tests,
and handling errors in tests that never expects to handle errors is
cumbersome.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
b8d0eb80d7 tests/test-client: Move out command line handling into helper
This will allow adding more API for more convenient test client
scripting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
3c65b8d9e0 build: Store generated Wayland protocol files in table
This makes it possible for e.g. test cases to pick protocol extensions
to include.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
79e1fc63ad tests: Add service door Wayland test case
Checks that the MetaWaylandClient from the service door is the one
owning the client connection opened via the D-Bus interface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
74fcdb9a62 Introduce the 'service channel' D-Bus service
The service channel D-Bus interface aims to be a "back door" for
services that needs special casing in Mutter, e.g. have custom private
protocols only meant to be used by that particular service.

There are currently no special casing implemented; only the basic
service channel infrastructure is added. There is a single method on the
interface, that is meant to eventually be used by
xdg-desktop-portal-gnome to open a Wayland connection with a private
protocol needed for the portal backend's rather special window
management needs.

The service channel Wayland client works by allowing one instance of
each "type", where each time needs to be defined to work in parallel. If
a new service client connects, the old one will be disconnected.

MetaWaylandClient's are used to manage the service clients, and are
assigned the service client type.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
a2f93e76a3 wayland/surface: Add getter for the surface wl_resource
Meant to avoid dereferencing the MetaWaylandSurface struct directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
5d888f2df6 tests/wayland-client-utils: Add way to create display from fd
Allows for more complex connection management.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
337ade622c tests/wayland-test-utils: Add helper to wait for window
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
9856dac593 tests/wayland: Move out window finder helper to helper file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
91c40a47b3 wayland: Add wl_global filter manager
One can add a wl_global filter to a wl_display instance, which can be
used to decide what clients should see what globals. This has so far
been used to limit a Xwayland specific protocol extension to only
Xwayland. In order to expand the logic about what globals are filtered
to what clients, introduce a filter manager and port the Xwayland
specific protocol filter to this new manager.

Tests are added, using a new dummy protocol, to ensure that filtering is
working as expected.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
192401dee5 wayland/compositor: Add API to get wl_display
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
63c8c229d6 wayland/client: Add API to check if it matches a wl_client
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
71e0bc0cbf tests/wayland-unit: Fix include order
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
e9eb1f504e tests/build: Fix test driver protocol code target name
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
99a0dd447b tests: Move Wayland protocols to dedicated directory
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
056a65bb01 tests: Add MetaWaylandClient test cases
It only tests indirect clients, i.e. not the subprocess part, so far,
but tests explicitly terminating by destroying the MetaWaylandClient
object, as well as the client self terminating and the signal being
emitted.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
61a3188d44 wayland/client: Add way to create indirectly launched clients
This API creates a "client" then later sets up a wl_client and returns a
file descriptor some Wayland client can connect to. It's meant to be
used as a method other than WAYLAND_SOCKET and process launching, e.g.
passing a file descriptor via a D-Bus API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
f129929c3f wayland/client: Put subprocess specific fields in anon struct
There will be two kind of client instances, lets move fields that are
only relevant to the current way of operation in an anonymous struct to
keep things a bit separate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
3042f56450 wayland/client: Put wl_client creator in helper
Will be used to create clients in other way than a subprocess launcher
and WAYLAND_SOCKET environment variable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
2023-02-13 15:34:24 +00:00
Jonas Ådahl
ff56305e6f wayland/client: Keep track of wl_client aliveness
Clear the wl_client pointer if the client is destroyed, and emit new
signal if it happened.

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
df16cb9fb7 Revert "display: Do not move X11 input focus during grabs"
This patch unfortunately results in situations where it is intended
that the focus change happens while a grab is present (e.g. Alt+tab
popup), resulting in confused focus state.

This commit is reverted in order to try a similar approach at a
different level.

This reverts commit 7531669b4f.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2832>
2023-02-13 12:45:37 +00:00
Quentin PAGÈS
221d208410 Update Occitan translation 2023-02-12 20:47:12 +00:00
Asier Sarasua Garmendia
9b5fa9234f Update Basque translation 2023-02-12 18:42:05 +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
014cde6461 wayland: Do not use GDK functions on XDnD implementation
We used it to retrieve a Display, and convert between Atoms and
strings. We can just use the MetaX11Display's Display (It's the
same than GDK's anyways) and use XInternAtom/XGetAtomName for
these conversions.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2836>
2023-02-10 20:43:11 +00:00
Jonas Ådahl
84b6913f8a wayland/xdg-foreign: Fix race condition crash
We didn't always set an implementation, when the foreign toplevel wasn't
found, and when the importer tried to set the parent-child relationship,
the implementation was missing and we'd crash in wl_closure_invoke() in
libwayland-server.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2834>
2023-02-10 18:38:39 +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
228d681be8 wayland: Trigger full focus sync after keyboard focus surface is destroyed
This used to be implicitly done by popups using a META_GRAB_OP_WAYLAND_POPUP
MetaDisplay grab. Since commit a8cd488c6f Wayland popups no longer do that,
so the keyboard focus was simply unset if a popup was destroyed while having
the keyboard focus.

Trigger a full input focus sync, so the correct MetaWaylandKeyboard focus
surface is looked up from the focused MetaWindow.

Fixes: a8cd488c6f - wayland: Drop redundant MetaDisplay grab op
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2833>
2023-02-09 16:23:36 +01:00
Carlos Garnacho
c4d8ba0f72 wayland: Avoid entering MetaWindow on other than user pointer motions
On one hand, this used to be handled generically in all the paths that
changed the MetaWaylandPointer focus surface, induced by user interaction
or not.

On the other hand, just listening for crossing events is not sufficient
since those also do happen programmatically. We must only listen to
crossing events that have a physical source device, meaning this was
created through user interaction.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/888
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
2023-02-09 14:41:04 +01:00
Carlos Garnacho
e58f716fb1 clutter: Pass source device onto crossing event generation machinery
For motion-induced crossing events, this will be the device that generated
the motion. For code-induced crossing events (e.g. grabs or actors disappearing)
this will be none.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2828>
2023-02-09 14:38:39 +01: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
Erico Nunes
523b27e267 cogl/onscreen: Discard depth/stencil before swapping buffers
Marking the the depth/stencil as discarded before swapping buffers for
the screen signals the GPU that we don't need to keep them around for
the future.
This helps performance by reducing memory bandwidth usage in some GPUs
which may optimize to not write those buffers back to memory at all
after rendering, when they would just be cleared right after that
anyway.
It is not necessary to mark buffers as discarded after swapping buffers.
This should have no effect according to the spec (since that is going to
be followed by new rendering commands which make the buffer valid again)
and removing that has shown no impact in performance tests.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2091>
2023-02-08 15:01:34 +00:00
Erico Nunes
5fedd065c9 cogl/framebuffer: Remove requirement to discard color buffer
cogl_framebuffer_discard_buffers required that the color buffer is
passed, although users might want to discard e.g. just depth and/or
stencil buffers.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2091>
2023-02-08 15:01:34 +00:00
Sebastian Wick
63522de4d0 tests/stacking: Change primary monitor handling
The first monitor in stacking tests is the primary monitor but that
doesn't have to stay this way forever. Instead of special casing the
name "primary" to refer to whatever monitor happens to be the primary
monitor, we add an `assert_primary_monitor` command to verify that the
monitor that should be the primary monitor actually is.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2748>
2023-02-07 17:52:19 +01:00
Sebastian Wick
4727609d2b tests/stacking: Move string to gboolean conversion to a helper
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2748>
2023-02-07 17:48:33 +01:00
Sebastian Wick
462c1115fe tests/stacking: Add a multi-monitor stacking test
New add_monitor command for adding secondary monitors. Support setting
the workspaces-only-on-primary preference.

The stacking test tests the focus and stacking for multiple monitors
with workspaces-only-on-primary=true. The default_focus changes
previously broke this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2748>
2023-02-07 15:45:28 +01:00
Sebastian Wick
1920d55ef9 tests/stacking: Test stacking order with raise-on-click = false
Makes sure the focus changes but the stacking stays the same. Also
checks that the stacking and focus on a workspace stays the same when
changing between them.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2748>
2023-02-07 15:40:08 +01:00
Sebastian Wick
f6d96a6118 tests/stacking: Add support for moving the cursor and clicking
Also test that clicking on a window will focus and raise it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2748>
2023-02-07 15:16:39 +01:00
Jake Dane
619fc55408 desktop: Remove obsolete desktop file
The X-GNOME-Bugzilla-* entries in the desktop file were for use by
bug-buddy, a GNOME 2 technology that's been gone for over a decade.
These entries are obsolete and the desktop file can be removed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2621>
2023-02-06 15:19:17 +00:00