32829 Commits

Author SHA1 Message Date
José Expósito
406de0d6d7 monitor-manager: Add forlease config to monitors.xml
Allow to configure a list of monitors as available for lease in
monitors.xml.

The monitors available for lease, must be disabled as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4112>
2024-11-06 15:36:21 +00:00
Sebastian Wick
11ef52639f docs/building-and-running: Be more clear about remote desktop
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3943>
2024-11-06 14:31:34 +00:00
Sebastian Wick
7a4a2ebd36 backend/x11: Make nested and cm subclasses final
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:54:35 +01:00
Sebastian Wick
e47379faad backend: Split dispose into dispose and finalize
Components which do not keep references to other components can be moved
to finalize and be available for longer which can help to shut down the
other components.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:54:35 +01:00
Sebastian Wick
8da99b69e2 backend: Add newlines to break the illusion of grouping
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:53:40 +01:00
Sebastian Wick
007058aac4 backend: Re-order backend component initialization
Move components without dependencies to the top and try to move
components with dependencies close to the component they depend on.

While this is an improvement, we really should start tracking and
documenting the actual dependencies between our components so that the
order here becomes comprehensible.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:52:43 +01:00
Sebastian Wick
2641d28a80 backend: Move stage creation to own function
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Sebastian Wick
01f7ba70e9 backend: Move InputMapper creation and signal connection to function
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Sebastian Wick
acc148ab7c backend: Move cursor tracker creation to function
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Sebastian Wick
ad4f0b74d5 backend: Move constructed to initable_init and init_basic
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Sebastian Wick
d289ef9434 backend: Move subclass initable to specialized init vfuncs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Sebastian Wick
ed1bd6c005 backend: Move in_init from object init to initable_init
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Sebastian Wick
57bceb0759 backend: Split post_init into init_basic, init_render, init_post
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
2024-11-06 13:51:05 +01:00
Bilal Elmoussaoui
eb5e6036be window: Add get_client_content_rect
In acbb14f34bc8fee14e77db3c100e5d116d8e3d60, we have dropped the
is_client_decorated except it was still being used by gnome-shell
to adjust the window coordinates in case it is using server side
decoration.

Instead of re-adding the same function, expose a new function that
takes care of getting the whole client area while taking into account
SSD for X11 clients.

Helps https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7984

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4087>
2024-11-06 11:04:15 +00:00
Sebastian Wick
d4fcef04d6 clutter/offscreen-effect: Use better names for the painted PipelineNode
Using the type name makes it easier to spot what's going on with
COGL_DEBUG=show-source.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
2024-11-06 10:51:55 +00:00
Sebastian Wick
4938987d97 clutter/paint-nodes: Avoid useless copying of the LayerNode pipeline
The constructor already copies the pipeline which means we can add a
snippet safely without affecting the parent pipeline, without creating
another copy.

Fixes: 6b07141f1a ("clutter/paint-nodes: Make paint nodes handle color transformations")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
2024-11-06 10:51:55 +00:00
Sebastian Wick
5e98ee5dbe cogl: Add pipeline hooks to user program pipelines
Instead of just adding the cogl header boilerplate, we'll redirect the
main function with #define and #undef to cogl_main(). The real main
calls the hooks-generated cogl_hooks() which chains up to the users
main() which is now called cogl_main().

    <boilerplate>
    #define main cogl_main
    <user shader>
    <hook functions>
    void
    cogl_hooks () {
      cogl_main ();
      <hook code>
    }
    #undef main
    void main () { cogl_hooks(); }

This allows the user shader to continue using shaders which seem like
they define the main function and output to the framebuffer but also
gives the CoglPipeline a chance to add hooks.

This in particular makes our ClutterColorState transform hooks work on
user programs which are used by ClutterShaderEffects.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7804
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7805
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3662
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
2024-11-06 10:51:55 +00:00
José Expósito
62e5706ed5 dbus-interfaces: Fix type in GetCurrentState doc
The XML type is correct, but the documentation was missing a string.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4116>
2024-11-04 21:52:56 +00:00
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