1
0
Fork 0
Commit graph

31750 commits

Author SHA1 Message Date
Bilal Elmoussaoui
4b26feafac tests/wayland-clients: Pass WaylandDisplay as user_data
Avoids using a static and make sure things are properly freed by
using g_autoptr. Also take the opportunity to add some missing NULL
initialization for auto-pointers variables

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3687>
2024-04-04 14:51:21 +00:00
Athmane MOKRAOUI
c0c0b70599 Update Kabyle translation 2024-04-04 12:24:33 +00:00
Bilal Elmoussaoui
260a8d92dc cogl: Use uint64_t for size params
As we are using a GParamSpecUint64 for that property
which makes it fail under 32bits platforms

Fixes: 6efd4a228 ("cogl/cleanup: Use construct-only properties for
CoglBuffer")
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3408

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3683>
2024-04-03 14:30:49 +00:00
Carlos Garnacho
bc72428a02 backends/native: Declare variables at beginning of block
In consistence with the code style, and in order to fix build errors
with older clang:

    ../src/backends/native/meta-onscreen-native.c:521:7: error: expected expression
      521 |       graphene_rect_t src_rect;
          |       ^
    ../src/backends/native/meta-onscreen-native.c:529:39: error: use of undeclared identifier 'src_rect'; did you mean 'dst_rect'?
      529 |                                      &src_rect);
          |                                       ^~~~~~~~
          |                                       dst_rect
    ../src/backends/native/meta-onscreen-native.c:522:20: note: 'dst_rect' declared here
      522 |       MtkRectangle dst_rect;
          |                    ^

And warnings with newer clang:

    ../src/backends/native/meta-onscreen-native.c:521:7: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
      521 |       graphene_rect_t src_rect;
          |       ^

This should allow the build for coverity to succeed again.

Fixes: adc776d0d7 ("crtc/kms: Pass on src and dst rects to primary plane assignments")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3686>
2024-04-03 10:37:17 +00:00
Carlos Garnacho
3207b9d8c5 ci: Check repo sanity
Check that the container registry in user repositories is
enabled, and issue a more descriptive error around it. Lifted
from Tracker.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3681>
2024-04-02 11:16:31 +02:00
Nathan Follens
f4b3322b77 Update Dutch translation 2024-03-31 10:13:31 +00:00
Rachida SACI
c438e7389b Update Kabyle translation 2024-03-30 09:31:52 +00:00
Austin Shafer
e8b890ab53 wayland: Implement linux-drm-syncobj-v1
This implements the explicit sync protocol linux-drm-syncobj-v1. This
works by importing a DRM syncobj timeline and importing/exporting fds
to/from the sync points on the timeline corresponding to buffer acquire
and release. We take fds for sync points provided during a surface
commit and use them to delay transaction application, and fetch fds
from Cogl to signal when we are done using a particular buffer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:28:08 -04:00
Austin Shafer
7ca01867f7 wayland: Add linux-drm-syncobj v1 to build
This adds the explicit sync wayland protocol to the list of build
dependencies.

This adds a copy of the linux-drm-syncobj protocol that we will use
privately for builds. This avoids the pain of requiring wayland-protocols
1.34 for distros. This commit can be reverted once we want to use
linux-drm-syncobj from the system wayland-protocols.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:27:42 -04:00
Austin Shafer
8e9f01d1ce wayland: Add MetaDrmTimeline
This abstracts away directly dealing with DRM syncobjs. Explicit
sync code can simply create a MetaDrmTimeline and request an fd at
a particular sync point.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:27:42 -04:00
Austin Shafer
99209958b9 cogl: Store latest GPU work completed sync fd
This keeps an internal sync_fd for the latest work submitted to
the GPU. This can then be fetched with cogl_context_get_latest_sync_fd
for use. This is intended for use with linux-drm-syncobj-v1

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:27:42 -04:00
Ray Strode
3f5bf42ab6 wayland/buffer: Don't assert mutter supports all shm formats
On big endian architectures the mapping of drm formats to cogl
formats is significantly trimmed compared to on little endian
architectures.

meta_wayland_init_shm tries a bunch of formats, including some
that just aren't mapped on e.g. s390x.

The code asserts the mapping will exist, however, leading to
crashes when Xwayland starts.

This commit makes failure to find a mapping non-fatal.

Suggested by Jonas Ådahl.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3672>
2024-03-27 10:16:47 -04:00
Athmane MOKRAOUI
a70cf1d5f2 Add Kabyle translation 2024-03-23 14:40:36 +00:00
A S Alam
e4dd50e1dd Update Punjabi translation 2024-03-18 13:13:23 +00:00
Florian Müllner
c4753689e3
Bump version to 46.0
Update NEWS.
2024-03-16 14:43:07 +01:00
Jonas Dreßler
64a1da9363 clutter/input-method: Check for equality before notifying properties
ClutterInputMethods content hint or purpose will be set again (even to the
same values) whenever a wayland client sends us a new content type/purpose.
Gtk appears to always set a content purpose on wl_text_input changes, so we
currently set and notify the "content-purpose" property on every change in a
gtk text field.

Since the OSK is gnome-shell listens to this property and re-generates its
entire layout when the content-purpose prop gets notified, this is currently
causing lag/freezes on every keypress in the OSK in gnome-shell.

So ensure to not notify these properties in case they're equal and set the
properties in the same way as we usually set them instead of going via
GObject.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3645>
2024-03-16 12:32:49 +01:00
Jocelyn Falempe
a775241efd backend/native: Use drmModeCloseFB for flicker-free login
When logging in from gdm to gnome, the main plane is deactivated, and
leads to the screen going blank before gnome is able to enable it
again.
Using the new CloseFB ioctl, allows to keep the gdm login screen
displayed until gnome-shell replace it.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3659>
2024-03-16 10:45:41 +00:00
Sebastian Wick
a50bc0ff7d onscreen/native: Only set a VRR update if the CRTC supports the property
This also gets rid of the MetaFrameSyncMode enum and instead issues a
VRR update when the requested state differs from the CRTC state.

Fixes: fee33299 ("onscreen/native: Allow requesting frame synchronization")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3646>
2024-03-16 10:28:30 +00:00
Sebastian Wick
51811ec7b3 output: Add a function to check if VRR is enabled for the output
An output with enabled VRR requires that the mode is a VRR mode which
also means that VRR is supported.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3646>
2024-03-16 10:28:30 +00:00
Sebastian Wick
91e3180985 output/kms: Track in OutputInfo if the output is VRR capable
This includes checking the vrr_capable property on the connector as well
as the VRR_ENABLE property on any CRTC the connector might get assigned
to. Also takes into account when a GPU is tagged for broken VRR support.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3646>
2024-03-16 10:28:30 +00:00
Sebastian Wick
514a18fe0c kms/crtc: Track if the VRR_ENABLED property is supported
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3646>
2024-03-16 10:28:30 +00:00
Bilal Elmoussaoui
f480de4ecd plugin-manager: Guard MetaPluginClass.xevent_filter
As we are getting close to have a Wayland-only build, guard those usages
so we don't 'regress'.
Once Kiosk figures it use case, we can revert both this commit and the
previous one.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3652>
2024-03-16 04:11:38 +01:00
Bilal Elmoussaoui
eb1d1883c2 Revert "plugin-manager: Drop MetaPluginClass.xevent_filter"
This reverts commit 917526ee9d.

As it is currently used by GNOME Kiosk, until upstream figures out
how to replace that code path, let us revert the commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3652>
2024-03-16 04:09:41 +01:00
Balló György
35335e65af window: Queue resize if window is maximized on wayland
When multiple configure requests sent to the wayland client within a sort period, maximized windows may end up in wrong position and cover struts. To avoid this, queue a resize when the resize event sent by the wayland client results a changed size or position to ensure that the final size and position will be always right.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3601>
2024-03-15 20:44:33 +00:00
Robert Mader
d434518303 wayland/surface: Remove some trailing spaces
To make the CI happy.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3662>
2024-03-15 17:09:42 +00:00
Robert Mader
f1a4758ce2 window-actor/wayland: Access single pixel buffer object directly
Using `meta_wayland_single_pixel_buffer_from_buffer()` can fail if
the buffer resource is already gone. Given that we release the buffer
immediately, that is actually expected - but the client this was tested
with did/does not do so.

This made the single pixel black bar optimization fail for
GstWaylandsink, while working for the mpv Wayland backend.

Access the object directly, which is both faster and works as long as
the buffer is alive.

Fixes: ed50cbbfe4 (window-actor/wayland: Update scanout candidate check)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3662>
2024-03-15 17:09:42 +00:00
Jonas Dreßler
f62e30b761 tests/clutter/conform: Add a test for gesture-relationships
Add a few tests for gestures sharing a sequence and how they influence each
other.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-15 00:09:09 +01:00
Jonas Dreßler
f61c095ccb tests/clutter/conform: Add some tests for ClutterGesture
This is testing the basic things like whether the state machine works
and that no memory is leaked.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-15 00:08:56 +01:00
Jonas Dreßler
6612c4fe41 clutter/gesture: Allow only a single gesture to recognize globally
Gestures are independent from each other when they are on different
actors and when they don't have a conflict over input with each other: For
example a gesture on one window and a gesture on another window will
recognize at the same time perfectly fine right now.

For those gestures (let's call them "independent gestures") we don't want
to control how the conflicting input should be handled, i.e. whether one
gesture wins over another or whether both can be recognizing using the
same touchpoint (e.g. zoom+rotate on the same actor). Instead we want
to control whether they are allowed to start while another one is running.

For now, make it impossible for two gestures to recognize globally at
the same time in all cases. This helps prevent subtle bugs and makes life
easier for users of the API. We can introduce API for fine grained control
over the behavior later.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-15 00:08:02 +01:00
Jonas Dreßler
6f84fb0a24 clutter/stage: Store a list of all active gestures on the whole stage
With the next commit, we'll need a list of all gestures that currently are
active globally. Since actors and actions (and therefore also gestures) in
Clutter are bound to a stage, it makes sense for this list to exist on the
ClutterStage level.

The list itself is a simple GPtrArray (to allow for quick searches) that
doesn't reference the gestures and is not manipulated by the stage itself.
All manipulation of the array is left to ClutterGestures.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-15 00:08:02 +01:00
Jonas Dreßler
63cc4da4f9 clutter/gesture: Cancel other gestures when moving to RECOGNIZING
Quite often there are situations where multiple gestures try to
recognize, keeping track of the same set of points (for example an edge
drag gesture on the stage and a click gesture somewhere in the
scenegraph). Usually what's wanted here is that the first gesture to
move to RECOGNIZING wins over all other active gestures and "claims" the
point for itself.

We implement this by introducing a concept called "influencing". It
works by making all gestures operating on a shared set of points aware
of each other using ClutterAction->register_sequence().
ClutterGesture uses this vfunc to keep track of all other
ClutterGestures that are potentially conflicting, and keeps a list
(priv->cancel_on_recognizing) of those. As soon as the move to
RECOGNIZING happens, all gestures inside this list get moved to
CANCELLED.

To allow fine-grained control over this behavior, two APIs are
introduced:

1) on the implementation level (should_influence() and
should_be_influenced_by()): This is a vfunc that gets called as soon as
a potential conflict is detected. It's helpful when a specific gesture
always behaves the same towards another gesture, for example to make
sure a LongPress gesture never cancels a DragGesture.

2) on the gesture user level, clutter_gesture_can_not_cancel() is
introduced: This allows control for the user of a gesture to specify
that a specific instance of a gesture won't cancel another gesture.
Calling this twice so that both gestures can't cancel each other allows
for things like simultaneous recognition of a pinch-to-zoom and rotate
gesture.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-15 00:07:59 +01:00
Jonas Dreßler
7dd37558b1 clutter/gesture: Add a new ClutterAction for touch and mouse gestures
Introduce ClutterGesture, a new ClutterAction subclass and the successor
of ClutterGestureAction that brings the necessary tools to handle
sequences of events and abstract touch and mouse gestures from those.

The big difference compared to ClutterGestureAction is that ClutterGesture
provides the implementation with point_added/moved/ended and
sequences_cancelled events and expects the implementation to move the
ClutterGesture through the ClutterGestureState state machine. This state
machine is then used internally by ClutterGesture to coordinate with other
gestures.

With the next commits, ClutterGesture will handle relationships between
conflicting gestures completely by itself, allowing the implementation or
the user to specify the details of the relationship between two gestures.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-15 00:05:50 +01:00
Jonas Dreßler
2803c381ec clutter/event: Remove DEPRECATED flag from clutter_event_get_source()
clutter_event_get_source() is still valid for the case of crossing events,
just like clutter_event_get_related(). The latter is not deprecated, so the
former shouldn't be either.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-14 23:09:21 +01:00
Jonas Dreßler
7342863b9f Revert "clutter: Drop Event.get_source"
We'll need this API again when adding ClutterGesture.

This reverts commit 6032be04a0.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-14 23:09:21 +01:00
Jonas Dreßler
753156c7f2 clutter: Add GESTURES debug flag
This will be used with the next commit, where we introduce a new gesture
tracker for Clutter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-14 23:09:21 +01:00
Jonas Dreßler
05cb4a4443 clutter/action: Take a ref on actions during event handling
ClutterStage will unref an action in the middle of its own event handler in
case the action causes its own actor to be destroyed. In this case the
action would get freed underneath our feet. To avoid it, take a ref on the
action while calling its handle_event() vfunc, just as we do in
clutter_actor_event() while emitting an event to an actor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
2024-03-14 23:09:21 +01:00
Sebastian Keller
a1381ea6bc cursor-tracker: Move visibility-changed signal emission to the end
The gnome-shell magnifier listens to the `visibility-changed` signal
and calls meta_cursor_tracker_set_pointer_visible(false) when the
cursor became visible.

This leads to a reentrance in meta_cursor_tracker_set_pointer_visible()
and clutter_seat_uninhibit_unfocus() gets called twice, once from the
meta_cursor_tracker_set_pointer_visible(false) by the magnifier and then
the original meta_cursor_tracker_set_pointer_visible(true) continues,
after the first call has set is_showing to false again. This breaks the
inhibitor counting and the ability to use the cursor while using the
magnifier.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3661>
2024-03-14 20:00:06 +00:00
Carlos Garnacho
1cfc1aa92b wayland: Check surface before looking up modals
Near window destruction, there might be cases where the surface
actor does no longer have a surface, yet it's still in the stage
and eligible for picking. In that situation looking for modal
dialogs attached to this surface will evidently fail, so avoid
this check on a NULL surface.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3332
Fixes: 93a9e7f3f ("core: Move code ignoring events on windows with modals to Wayland")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3660>
2024-03-13 18:39:52 +00:00
Robert Mader
683e917854 cogl/winsys: Remove eglGetProcAddress workaround for EGL < 1.5
`eglGetProcAddress()` used to not work for core API in EGL versions
below 1.5. The workaround in place in turn can fail - notably for setups
with a local Mesa build in /usr/local.
EGL 1.5 is almost 10 years old and similar workarounds don't seem to be
in place for toolkits we rely on, notably GTK4. Thus remove it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3655>
2024-03-13 16:37:31 +01:00
Robert Mader
aaae07f9dd onscreen/native: Mark GPU rendering duration as valid if supported
Since commit e30eb78891 `ClutterFrameClock` assumes that a valid CPU time
implies timestamp query support, which is also checked in
`cogl_onscreen_egl_swap_buffers_with_damage()`.

Unconditionally setting the CPU time on direct scanout meant that the
compositing path would be stuck on the last (direct scanout optimized)
result on GL implementations without timestamp query support since.

be0aa2976e (clutter/frame-clock: Avoid rapidly toggling dynamic max render time)

Fix that by explicitly marking the gpu rendering duration as valid when
querying the GPU timestamps is supported and check for it ClutterFrameClock.

Fixes: 56580ea7c9 ("backends/native: Assume zero rendering time for direct scanout buffers")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3655>
2024-03-13 16:37:16 +01:00
Petr Hodina
e2b42cdfd9 monitor: Allow DPI connectors to be built-in displays
Needed for the Pinenote built-in display to be detected by Mutter
https://pine64.org/devices/pinenote/

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3067>
2024-03-13 13:14:01 +00:00
Zander Brown
8002919f7b meta: Update annotations
MetaBackend is part of the public API but MetaGPU is not so gpu-added
can cause confusion, treat it as gpointer.
Also ensure XEvent is properly recognised

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1918>
2024-03-13 12:52:41 +00:00
Zander Brown
6a445d2eef build: Make exported package in gir consistent
Additionally Cogl was missing xlib as an include

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1918>
2024-03-13 12:52:41 +00:00
Ask Hjorth Larsen
b62f2667db Update Danish translation 2024-03-12 22:00:31 +00:00
Sebastian Wick
5690bd3eaa wayland/output: Track protocol state for computing changed properties
This makes sure that xdg-output.logical_size and
xdg-output.logical_position are only sent when they actually changed.

There should be no behavior change in wl_output_transform_from_transform
but it now uses the same technique of tracking the protocol state and
comparing it to the current state to compute which properties have
changed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3622>
2024-03-12 19:21:27 +00:00
Sebastian Keller
f94e32037c background: Call malloc_trim() after loading background image
Some of the new JXL backgrounds from gnome-backgrounds can allocate
several hundred MB during loading, so let's call malloc_trim() after we
are done with loading the image into a pixbuf.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3327
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3653>
2024-03-12 17:27:29 +00:00
Bilal Elmoussaoui
6d03666d2d window/x11: Try harder to find the associated group
Otherwise we would try to create a new group later on which would crash

Fixes #3329

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3656>
2024-03-12 14:30:40 +01:00
Peter Hutterer
2a879be180 core: Whitespace fix
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3658>
2024-03-12 12:48:20 +10:00
Peter Hutterer
1f3dcc9201 tools/uncrustify: Fix invalid align_nl_cont value
Option<UNUM>: at tools/uncrustify.cfg:135: Expected unsigned number , for 'align_nl_cont'; got 'false'

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3658>
2024-03-12 12:48:20 +10:00
Peter Hutterer
d73c64a61c check-style: Force the default prefix in git diff
Our match statements rely on the `b/` prefix so let's make sure we
definitely get that one (i.e. undo diff.noprefix).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3658>
2024-03-12 12:47:56 +10:00