32811 Commits

Author SHA1 Message Date
Bilal Elmoussaoui
a5be92e03d Use _once variant of g_[timeout_idle]
Nice helpers that were added in GLib 2.72, so safe to make use of as we
depend on 2.81.1 already.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4115>
2024-11-04 21:18:37 +00:00
Danial Behzadi
ae4cdcf205 Update Persian translation
(cherry picked from commit a5295848614a23e7c1eb2cf57ea2f25891137112)
2024-11-04 09:48:15 +00:00
Bilal Elmoussaoui
0f5ec2ec16 window: Use getter for fullscreen state
Avoids going through struct field directly as we might replace that with
a WindowConfiguration type soon-ish.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4111>
2024-10-30 16:25:47 +01:00
Bilal Elmoussaoui
8e5433d82a window: Replace barely used macros with func equivalents
To avoid mostly going through struct fields in macros as we might soon
move those first to a WindowConfiguration & maybe even make the window
struct private with time.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4111>
2024-10-30 16:25:37 +01:00
Bilal Elmoussaoui
dabc13f7b8 clutter: Stop using get_default_backend helper
As it ends up using the global default context. So just call that
directly to easily spot the remaining usages of get_default_context.

Note that the helper will probably be removed later this cycle once the
remaining usages in meta & libst have been replaced with passing around
the context

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
696dfaa124 clutter/threads: Remove helper functions
See previous commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
d92893b6f3 clutter/threads: Remove _full functions variant
As they are not used anywhere, in the next commit
we will just remove the whole thing and use glib helpers directly as
there is nothing specific about ClutterThread anymore

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
40e7998669 clutter/pango: Avoid going through global context
As we have access to the actor context in most of the cases except for
render nodes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
93a05a0631 clutter/stage-window: Remove functions declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
a0dc7d9f1c clutter/a11y: Remove unused AtkUtil implementation
Following what GTK 3 does in
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/a11y/gtkaccessibilityutil.c. It only overrides AtkUtil's vfuncs

In the future, we would very likely switch away from using Atk and
follow the path of GTK 4, but it is still to be decided whether
we want to communicate with the accessibility bus manually or use
something like accesskit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
José Expósito
a92ecd7373 onscreen/native: Fix fd error check
meta_drm_buffer_dumb_ensure_dmabuf_fd () return -1 on error, not 0.

Fix the error check.

Fixes: 84bde805fe34 ("native: Consolidate DRM buffer management to MetaDrmBuffer types")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4109>
2024-10-29 15:21:03 +00:00
Olivier Fourdan
4c65cdec64 xwayland/surface: Connect "highest-scale-monitor-changed" signal
Similar to what MetaWaylandShellSurface does, connect the signal
"highest-scale-monitor-changed" to the handler
meta_wayland_surface_notify_highest_scale_monitor() so that
Xwaylandsurface can be notified of the fractional scale changes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3326
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3639>
2024-10-29 08:52:21 +00:00
Nathan Follens
fef2be5c5f Update Dutch translation
(cherry picked from commit d73b402e92b1ba9906b3f299b3e2518c98b8635d)
2024-10-27 22:40:56 +00:00
Joan Torres
56d5b36b86 clutter/color-state: Fix of indentation and duplicated endline
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4108>
2024-10-25 17:30:23 +02:00
Joan Torres
8f709f26e7 wayland/color-management: Fix setting luminances
It was missing setting luminance type to explicit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4108>
2024-10-25 17:30:23 +02:00
Joan Torres
24712ba3a8 clutter/color-state: Fix threshold on bt709 eotf
It was used the same threshold used at the inv eotf.
Use the right one getting it from the function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4108>
2024-10-25 17:30:23 +02:00
Gert-dev
ceed33b68e onscreen/native: Use EGLSyncs instead of cogl_framebuffer_finish
cogl_framebuffer_finish can result in a CPU-side stall because it waits for
the primary GPU to flush and execute all commands that were queued before
that. By using a GPU-side EGLSync we can let the primary GPU inform us when
it is done with the queued commands instead. We then create another EGLSync
on the secondary GPU using the same fd so the primary GPU effectively
signals the secondary GPU when it is done rendering, causing the latter
to wait for the former before copying part of the frames it needs for
monitors attached to it directly.

This solves the corruption that cogl_framebuffer_finish also solved, but
without needing a CPU-side stall.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
2024-10-22 19:24:27 +00:00
Gert-dev
9cb01597c9 egl: Add helpers to manage and wait for EGLSync objects
This adds meta_egl_create_sync and meta_egl_destroy_sync to be able to
create and dispose EGLSync objects, respectively, as well as
meta_egl_wait_sync to be able to wait for an EGLSync on the GPU.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
2024-10-22 19:24:27 +00:00
Michel Dänzer
20b730c76c cogl: Remove unused found_egl_config field
Unused since 812aba31e700 ("winsys: Drop xlib_get_visual_info from the
vtable").

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4105>
2024-10-22 12:40:01 +00:00
Florian Müllner
7f624800bf compositor: Remove plugin_info() vfunc
Nothing has called it since commit 4fdbb466e1c ten years ago, so
drop the entire thing.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4104>
2024-10-21 23:41:00 +02:00
Florian Müllner
2a6bee224c tests/shell: Stop implementing plugin_info()
The hook would be optional if anything called `meta_plugin_get_info()`,
except that since commit 4fdbb466e1c ten years ago, nothing has done so.

It seems a bit pointless to export information that is completely
unused, so stop doing that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4104>
2024-10-21 23:31:16 +02:00
Florian Müllner
8172acab93 plugins/default: Stop implementing plugin_info()
The hook would be optional if anything called `meta_plugin_get_info()`,
except that since commit 4fdbb466e1c ten years ago, nothing has done so.

It seems a bit pointless to export information that is completely
unused, so stop doing that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4104>
2024-10-21 23:28:44 +02:00
Michel Dänzer
0348913afa cogl: Update latest sync fd also in cogl_onscreen_swap_region
Same as in cogl_onscreen_swap_buffers_with_damage.

Fixes: 99209958b90b ("cogl: Store latest GPU work completed sync fd")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4057>
2024-10-21 11:38:26 +00:00
Florian Müllner
e5c0887524 build: Use SPDX identifier for license field
SPDX has become the established standard for expressing FLOSS
licenses, and is what meson itself strongly recommends for the
license field.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4101>
2024-10-21 12:27:12 +02:00
Daniel van Vugt
817a951b24 clutter/frame-clock: Move "last" frame fields into structs
While in double buffering we only care about one previous presentation,
triple buffering will sometimes need to refer to the presentation from
two dispatches prior. So it might help to separate those frame stats
more clearly. This way each frame's dispatch and presentation times are
stored more cohesively such as to not be overwritten during overlapping
frame lifetimes.

Having two types of frame reference (dispatch and presentation) moving
at difference speeds meant that they could not be stored in a ring. Not
all dispatches become presentations and so storing them in a ring would
necessitate very complex conflict avoidance. Instead, a simple reference
counting model was used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
2024-10-21 08:47:36 +00:00
Daniel van Vugt
85f0f4e227 clutter/frame-clock: Notify on all empty frames
So that we maintain a perfectly balanced number of callbacks:

  dispatch == notify_ready + notify_presented

Otherwise you can't put any useful logic inside notify_ready and be sure
you're handling all the empty frames.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
2024-10-21 08:47:36 +00:00
Sebastian Keller
cb34fafd57 wayland/pointer-constraints: Warp pointer after destroying resource
e994fbf02 moved warping the pointer to before the destruction of the
resource to prevent dereferencing the constraint after destruction.
This however meant that the constraint was still active when the motion
event caused by the warp is handled, which would constrain the pointer
back again to its original position.

This moves the warping of the pointer back to after the destruction of
the resource and instead just retrieves the seat earlier while the
constraint is still valid.

Fixes: e994fbf02 ("wayland/pointer-constraints: Warp pointer before destroying resource")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3696
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4098>
2024-10-19 20:49:16 +02:00
Michel Dänzer
01249bd9e4 kms/impl-device: Don't merge KMS updates in process_mode_set_update
Based on the discussion leading to
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3999#note_2220825
this shouldn't be necessary.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4069>
2024-10-19 14:40:45 +00:00
Michel Dänzer
118f294a48 onscreen/native: Don't set sync_fd for KMS update if secondary GPU used
The sync_fd represents only the primary GPU work.

Fixes: c2621eca151d ("onscreen/native: Set latest cogl sync_fd on KMS update")

v2:
* Use g_steal_fd. (Georges Basile Stavracas Neto, Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>
2024-10-18 14:54:56 +00:00
Michel Dänzer
64ce8b2071 onscreen/native: Rename create_timestamp_query to secondary_gpu_used
This describes the condition it represents, rather than what it's
currently used for.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>
2024-10-18 14:54:56 +00:00
Robert Mader
faf4dc21ea meta/stage: Replace \r\n with \n
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4093>
2024-10-18 15:01:46 +02:00
Robert Mader
129a71d0ca cursor-renderer/native: Deduplicate scale and transform code
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4093>
2024-10-18 14:58:03 +02:00
Robert Mader
e32a788179 cursor-renderer: Do pixel alignment a bit later
To avoid multiple identical if statements.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4093>
2024-10-18 14:57:46 +02:00
Robert Mader
72ac8c6987 cursor-sprite: Use early exits when invalidating
To make the code easier to follow. While on it, use `G_APPROX_VALUE`
where appropriate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4093>
2024-10-18 14:54:45 +02:00
Florian Müllner
1bb53f06cf build: Rename meson_options.txt to meson.options
The name is a bit cleaner, and has been the preferred option(!)
since meson 1.1.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4090>
2024-10-18 02:39:21 +02:00
Guacamolie
f8a46b548a Revert "introspection: Make MetaKeyHandlerFunc compatible with master"
This reverts commit bad48ea8155d94af7b62bf4ff42d747f27c7464c.

Commit 666e5f1f9 (keybindings: Port to Clutter, 2013-10-03) changed the
Meta.KeyEventHandler callback so that it would take a Clutter.KeyEvent
instead of an XIDeviceEvent. This removed the need for the "(type
gpointer)" annotation, since Clutter works with introspection.

The gpointer annotation caused GJS to simply skip over the callback
argument. Since this was only the second-last argument, reintroducing it
required updating gnome-shell JS code that used the last 'binding'
argument. This was likely inconvenient at the time, since work was
happening in a separate 'wayland' branch, and compatibility with the
X11-only branch had to be kept. So shortly after, the gpointer
annotation was reintroduced with commit bad48ea81 (introspection: Make
MetaKeyHandlerFunc compatible with master, 2013-12-09), unbreaking the
gnome-shell JS code.

But now that the 'wayland' branch has long been merged, we can fix this
properly by removing the gpointer annotation and updating the JS
handlers instead.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4079>
2024-10-15 18:24:59 +02:00
Florian Müllner
0b3e85bf40 ci: Add pkgconf wrapper in install-common-dependencies
The script is used to install dependencies that are needed both
for the CI image and the gnome os system extension.

To avoid installing dependencies in an environment where they are
already satisfied, they should be guarded by an appropriate check,
most commonly pkgconf.

Right now these checks are straight-forward:
 - if a dependency is not in the base image, it will
   be built when building the CI image
 - if a dependency is not in GNOME OS, it will be
   built when building the GNOME OS system extension

However we will soon add another caller of the script, when
allowing to export a system extension from our development
toolboxes to the host.

That case is trickier, as the dependency *is* satisfied by
the build environment (because it is based on the CI image),
but it will still be needed by the exported system extension.

To account for that case, add a pkgconf wrapper that only searches
in PKG_CONFIG_DIRS in the specified destdirs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4075>
2024-10-15 14:06:24 +00:00
Florian Müllner
0f8ba949ab ci: Clarify --destdir help in install-common-dependencies
The --destdir option in install-meson-project is now cumulative,
so adjust the help output to clarify that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4075>
2024-10-15 14:06:24 +00:00
Florian Müllner
bcdab9d9c0 ci: Make --destdir option in install-meson-project cumulative
When building a system extension for GNOME OS, any extra
dependencies are needed both in the container (for building)
and the extension's destdir (for running).

Because of that, the --destdir flag that was added in commit
8aeb6dc86 does not only install to the specified directory
as expected, but also runs a second install step without
destdir (i.e. to the system).

However that behavior is not a good fit when we extend our
existing toolbox tooling to build system extensions for
Fedora instead of GNOME OS.

To account for that, make the --destdir option cumulative
and install the project to all provided destdirs (or /
if omitted).

This gives us the flexibility to install to the system, a
different destdir, or both:

```
 $ ./install-meson-project.sh  # install to system
 $ ./install-meson-project.sh --destdir /new/dest  # install to destdir
 $ ./install-meson-project.sh --destdir /new/dest --destdir /  # both
```

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4075>
2024-10-15 14:06:24 +00:00
Sebastian Wick
245dafe811 color-device: Set the color state to BT2020+PQ when HDR is forced
Sets the color state of all monitors to BT2020+PQ even if the monitor
isn't accpeting such a signal.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4035>
2024-10-15 10:37:36 +00:00
Sebastian Wick
2f3ad4be5c core/debug-control: Add new ForceHDR debug control
It will be used to force the color state of all monitors to be as if
they managed to turn on HDR mode. This is useful for debugging shaders
in an environment where an HDR mode capable display is not available,
such as the nested mode.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4035>
2024-10-15 10:37:36 +00:00
Doğukan Korkmaztürk
6a0cc1371c stage-impl: Ensure that a sync object is created in headless mode
During an onscreen swap, the cogl_onscreen_swap_buffers_with_damage()
function ensures that the Cogl renderer creates a sync object every
frame. This sync object is later shared with the Wayland clients that
utilize the explicit sync protocol.

However, in headless mode, the function mentioned above is not called.
As a result, the sync object the Cogl renderer stores seems to be not
created. This causes cogl_context_get_latest_sync_fd() function to
return an invalid sync fd, causing Mutter to not be able to materialize
the sync timeline point that the clients wait for when the explicit sync
protocol is in use.

This change simply adds a call to the cogl_framebuffer_flush() function
to the offscreen swap path to make sure that there is a sync object that
can be shared with the clients, which will be signalled when all the
queued operations before the swap are completed.

Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4056>
2024-10-15 09:22:42 +00:00
Sebastian Wick
ef58572df7 edid: Use libdisplay-info's high-level API for populating EdidInfo
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3602>
2024-10-15 09:10:21 +00:00
Sebastian Wick
c820a63b87 edid: Make libdisplay-info hard dep
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3602>
2024-10-15 09:10:21 +00:00
Florian Müllner
34c2767f81 keybindings: Pass generic ClutterEvent* to handlers
While the events when processing keybindings are quite obviously
key events, the individual structs are all opaque and all public
API is provided by the generic ClutterEvent type. That means that
any handler that uses the passed in event must cast it to
ClutterEvent anyway, so drop the cast to ClutterKeyEvent when
processing key events.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4080>
2024-10-14 14:10:05 +02:00
Bilal Elmoussaoui
ab95a95a1d docs/website: Use relative links
Allows easily browsing the docs from the CI artifacts

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4078>
2024-10-12 19:37:28 +02:00
Michel Dänzer
3cf3d5d1c6 kms/crtc: Complain and bail if DRM mode info isn't valid
Otherwise meta_calculate_drm_mode_refresh_rate returns 0.0, which
results in non-sense refresh_interval_us.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3982 fixed that
happening before. This is intended to catch if it ever happens again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3980>
2024-10-09 18:51:35 +00:00
Bilal Elmoussaoui
3eb5381c46 wayland/inhibit-dialog: Drop duplicated hide call
the destroy and the response handler, already hide the dialog
themselves. The calls here were unnecessary.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3048
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4034>
2024-10-09 10:24:12 +00:00
Florian Müllner
40773765df ci: Fix install-common-dependencies.sh -h
The option is advertised as alternative to --help, but doesn't
actually work. While not super important for a script that isn't
user facing, it's a trivial fix and doesn't hurt.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4074>
2024-10-09 00:57:31 +02:00
Florian Müllner
f452d38731 ci: Improve install-common-dependencies usage output
Indicate when options require a parameter, like in the previous
commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4074>
2024-10-09 00:57:31 +02:00