32942 Commits

Author SHA1 Message Date
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
Florian Müllner
01bab71256 ci: Improve install-meson-project usage output
Most of the options require a parameter, indicate that in the
usage output.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4074>
2024-10-08 21:51:27 +02:00
Bilal Elmoussaoui
54a7ffea81 clutter/pango: Follow coding style for function declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
463c36880e clutter/pango: Rename types post merge
The rename didnt happen as part of the merge as various bits were
removed the commits after, reducing the amount of required changes

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
f60e9e5e0d clutter/pango: Use memory management macros
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
e0291b4e8f clutter/pango: Don't take a callback for dirty glyphs
As the callback had nothing to do wth the renderer

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
269c3723be clutter/pango: Simplify show_layout
As it is a private function now, make it take the color & target color
states
De-duplicating the setup function between ClutterText & ClutterTextNode

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
de7eb11ed8 clutter/pango: Remove no mipmap cache
As it is always disabled, given that nothing can change that externally, remove all of that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
d75503d5f6 clutter/context: Free font map
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
76b2655495 cogl: Remove pango debug flag
As there is no pango usage as part of cogl anymore

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
7cae64fccd clutter/pango: Mark helpers as private
As they were public only for clutter to be able to use them
from pango. So simplify that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
40dc151e82 clutter/pango: Remove FontMap type
It was created just to keep an instance of the corresponding renderer /
context
Instead, move those fields into ClutterContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
fe3192169a Merge CoglPango inside of Clutter
As that is where the whole text rendering integration happens
And would allow us to get rid of some over-abstraction in cogl-pango,
simplify
ClutterSnapshot integration as well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
b6b004b437 cogl/pango: Make FontMap type private
It is an implementation detail, nothing really makes use of any of it
specific APIs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
cdc43065e0 cogl/pango: Remove font map helper
It only calls into pangocairo API and only used inside clutter
so just call pangocairo API directly

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
f5a4309f3c cogl/pango: Mark get_renderer as private
Nothing uses it externally

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
022977e7ba cogl/pango: Remove private cogl headers usage
As we will be merging CoglPango inside Clutter, so prepare for that
Note this removes the Cogl shared atlas debug usage, as it is private to Cogl

The usage of cogl_c_args was replaced with cogl_debug_c_args to avoid COGL_COMPILATION
pre-moving to clutter. The whole meson file will be removed later anyways.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
7c6effecb7 cogl/pango: Don't check if parent has a constructed override
There is always one

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
24af7ffc16 cogl/pango: Make Renderer private & final
Nothing uses it externally, so simplify pre-merging with clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
2955b4b855 cogl/pango: Remove unused functions & declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00