1
0
Fork 0
Commit graph

31966 commits

Author SHA1 Message Date
Jonas Ådahl
5dab10e441 mtk/rectangle: Add auto-cleanup integration
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3703>
2024-04-15 16:48:04 +00:00
Jonas Ådahl
3091449298 mtk/rectangle: Add constructor for an empty rectangle
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3703>
2024-04-15 16:48:04 +00:00
Robert Mader
1f82365021 window-actor/wayland: Improve scanout candidate check
By ignoring obcured surfaces we can generalize the single-pixel-buffer
background check to work with arbitrary surface trees, as long as the
two top ones are the background and content surfaces.

As a nice side effect of this, clients like Firefox now usually take the
shorter `meta_window_is_fullscreen (window) && n_visible_surface_actors == 1`
route.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3699>
2024-04-15 15:52:26 +00:00
Jonas Ådahl
e5068bfc91 wayland/single-pixel-buffer: Fix reusing buffer
We had missed to actually return the cached texture, so do that.

Also add a test.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3432
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3702>
2024-04-15 17:37:52 +02:00
Michel Dänzer
a834eb5c94 onscreen/native: Don't create timestamp query with secondary GPU work
The timestamp query is currently always created for the primary GPU, so
it doesn't cover any later secondary GPU work.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3070
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3689>
2024-04-10 11:59:30 +02:00
Michel Dänzer
09267d0bdd cogl/onscreen: Add cogl_onscreen_egl_maybe_create_timestamp_query
Move the code out of cogl_onscreen_egl_swap_buffers_with_damage, and
call the new function from callers of the former.

v2:
* Use early return if the cogl context doesn't support timestamp
  queries. (Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3689>
2024-04-10 11:17:23 +02:00
Michel Dänzer
0bbc25f694 cogl: Update latest sync fd from cogl_onscreen_swap_buffers_with_damage
Preparation for later changes, no functional change intended.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3689>
2024-04-10 11:17:19 +02:00
Michel Dänzer
40950f99b3 drm-buffer-gbm: Do not call ensure_fb_id from lock_front
When preparing a frame for scanout on a secondary GPU, calling
meta_drm_buffer_gbm_ensure_fb_id for the primary GPU device is
unnecessary and potentially harmful.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3389
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3674>
2024-04-09 08:28:59 +00:00
Gwan-gyeong Mun
8f08e39e00 Update Korean translation 2024-04-08 14:34:22 +00:00
Rachida SACI
e2d12d80ed Update Kabyle translation 2024-04-08 10:23:42 +00:00
Bilal Elmoussaoui
34d79b9ddf cogl: Make sure generated enum header is built before sources using it
Fixes: 63a558950 ("cogl: Generate a GType for PixelFormat")
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3413

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3690>
2024-04-07 14:29:07 +00:00
Barnabás Pőcze
c0ae617b3f tests/mtk/region: Fix MtkRectangle leak
`mtk_rectangle_new()` allocates the object dynamically,
but in the "contains-point" test case the allocated object
was not freed. Fix that by creating the object on the stack.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3679>
2024-04-05 15:10:18 +00:00
Daniel van Vugt
22689d722a compositor/sync-ring: Allow the gpu_fence to be moved
When the compositor inserts two waits in a frame, such as f606a4424a,
the second insertion shouldn't break the ring's state machine as easily
as it does. We can instead merge the two GL waits into one by simply moving
the GL fence to the latest insertion. Each insertion still does its own X11
sync though.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3384
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3685>
2024-04-05 14:18:12 +00:00
Jonas Ådahl
82c0f9c57d cursor-renderer/native: Don't predict the dumb buffer stride
The stride of the dumb buffer isn't necessarily 4 * width even if the
bytes per pixel is 4, so lets not make that assumption.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2267951
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3666>
2024-04-05 14:06:54 +00:00
Ivan Molodetskikh
25c9cff7be dbus-interfaces: Fix layout-mode comment
This corresponds to the values in the code. The second comment is
correct.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3671>
2024-04-05 13:45:01 +00:00
Bilal Elmoussaoui
ee3221f146 tests/wayland-clients: Avoid using static when not needed
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3687>
2024-04-04 14:51:21 +00:00
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