1
0
Fork 0
Commit graph

32021 commits

Author SHA1 Message Date
Jonas Ådahl
f19f8fcb16 clutter/frame-clock: Only update immediately after idle if vsynced
If the presentation time isn't known, e.g. if the monitor is virtual and
the actual presentation happens far away, the presentation time we
actually received tends to be the time a frame was presented to the next
layer, meaning practically immediately after painting.

When scheduling another update after that, don't assume that if the next
calculated update is not the immediate next update, schedule an update
sooner, as that will in such cases always be true, meaning we ended up
busy looping with constant frame updates being scheduled.

Fix this by only triggering that logic if the last presentation time was
actually vsync:ed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-12 15:11:04 +00:00
Bilal Elmoussaoui
27ecc9d1cd clutter/color: Stop falling back to PangoColor for X11 colors
As we don't really make use of that feature anyways. The
ClutterColor.from_string API is used by gnome-shell to retrieve the
following settings: cross-hairs-color, primary-color, secondary-color
which are always set in their hex representationby gnome-control-center.

Helps https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3544

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3796>
2024-06-12 14:32:14 +00:00
Jonas Ådahl
5bca761148 kms: Don't use kernel thread when headless
We're not doing anything significant in the KMS thread anyway, so don't
make it a kernel thread, and don't ask to be real time scheduled (which
we wouldn't be anyway, but for clarity).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3805>
2024-06-12 11:06:54 +00:00
Jonas Ådahl
6bd2fd6a74 backend/native: Find render node directly via udev
Don't try to find the card, and then the render node from it, just ask
udev to list the render nodes directly. This avoids running into
permission errors when the user cannot open /dev/dri/card* even without
mode setting capabilities.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3805>
2024-06-12 11:06:54 +00:00
Bilal Elmoussaoui
014ea91a9d cogl: Remove various DepthState functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3804>
2024-06-12 00:42:45 +00:00
Bilal Elmoussaoui
bb29fa68fe cogl: Remove AtlasTexture.new_from_data
Nothing uses it, allows to drop the corresponding test case as well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3804>
2024-06-12 00:42:45 +00:00
Bilal Elmoussaoui
94c2c41b66 cogl: Remove unused features functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3804>
2024-06-12 00:42:45 +00:00
Bilal Elmoussaoui
ed0ee25843 cogl: Remove header-only Pipeline functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3804>
2024-06-12 00:42:45 +00:00
Bilal Elmoussaoui
863d4ad6d6 cogl: Remove various unused MatrixEntry functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3804>
2024-06-12 00:42:45 +00:00
Bilal Elmoussaoui
adf0acbe0d cogl: Remove various unused Attribute functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3804>
2024-06-12 00:42:45 +00:00
Bilal Elmoussaoui
6c972546f1 mtk: Add Rectangle.contains_point
By turning a macro that exists in the codebase to a proper
function so that gnome-shell could make use of it as well
instead of using a region for it contains_point api...

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3801>
2024-06-11 00:49:28 +02:00
Daniel van Vugt
2f8a598582 kms/impl-device: Add debug logging for deadline dispatch lateness
And also "completion" time to measure when the commit returned.

This is structured so as to measure all timestamps first before logging
anything. That way our results shouldn't be (don't seem to be) affected
by the logging itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3265>
2024-06-10 13:55:21 +08:00
Daniel van Vugt
cf87eae00b kms/impl-device: Remember the expected deadline dispatch time
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3265>
2024-06-10 13:55:21 +08:00
Daniel van Vugt
052def76e6 Add debug topic "kms-deadline"
Which will allow us to report on deadline timings without influencing
the CPU clock like the busy "kms" topic does.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3265>
2024-06-10 13:55:21 +08:00
Carlos Garnacho
e731f2a055 wayland: Double check surface/window before looking for modals
While it should not be expected that we pick the pointer into a
MetaSurfaceActor that is disembodied of its MetaWaylandSurface/MetaWindow,
the paths where this should be enforced are somewhat scattered.

So account for the situation in picking code, and prefer a NULL surface
over a crash. This operates on the assumption that this inconsistent state
where Mutter didn't know better to pick a correct surface actor will be fixed
by later crossing events resolving the intermediate state, and that no
other input events will be received meanwhile.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3393
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
2024-06-07 17:02:14 +02:00
Carlos Garnacho
66e23b009c wayland: Make subsurface actors unreactive early during destruction
When unmapping a subsurface, it does lose early its connection to the
parent surface. This is however a deciding factor in determining whether
the surface (role) has a window.

Make the subsurface actor unreactive if its connection to the parent
MetaWindow was severed, since it should not be eligible for picking anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
2024-06-07 17:02:13 +02:00
Carlos Garnacho
17dc9393e0 compositor: Make surface actors unreactive after losing their surface
These actors are expected to be destroyed along with their surface, this
however happens later in the process, so there is a moment where actors
are eligible for picking, but do not have a surface anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
2024-06-07 17:01:26 +02:00
Sebastian Wick
c166b3fc5b wayland/activation: Apply xdg-activation request when window gets mapped
If the window is not mapped yet and we get an activation request, we
will wait for the window to get mapped or destroyed to try to fullfil
the request.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3728>
2024-06-07 12:06:12 +02:00
Sebastian Wick
77b115399c window/x11: Remove unnecessary user_data
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3728>
2024-06-07 12:05:36 +02:00
Sebastian Wick
fdf9c32dac window: Replace map/unmap vfunc with signal
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3728>
2024-06-07 12:04:27 +02:00
Sebastian Keller
a99e139a68 events: Don't check for stage grabs before sending events to ibus
Prior to the grabs/focus rework in !3420, Wayland grabs were handled
separately from ClutterGrabs. This required explicitly checking for
ClutterGrabs as those were expected to prevent events from reaching
Wayland clients.

Now after !3420, Wayland client grabs also result in ClutterGrabs, which
means that this check causes input events for popups with grabs to not
get sent to ibus anymore. Instead the events are getting sent to the
client directly, which results no ibus support in popups (unless the
client handles that itself by using a different GTK_IM_MODULE).

However due to the changes from !3420 checking for ClutterGrabs is also
no longer necessary and the meta_wayland_text_input_update() focus check
is now sufficient to only forward events to ibus, when the focus is
actually on a Wayland client. So to fix this we can simply remove the
check.

Fixes: 2a584a8f0 ("wayland: Make use of Wayland event grabbing mechanism")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3502
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3787>
2024-06-05 15:53:40 +00:00
adarshgm
0ca933baec backend/native: Adds support for SIZE_HINTS Cursor Plane Property
Reads exposed size hints for the given cursor plane. Chooses nearest
minimum cursor size out of the hints with respect to the user chosen
cursor size from the UI. Allocates optimized Hardare cursor size,
hence drm buffer

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3165>
2024-06-04 16:39:16 +00:00
Jonas Ådahl
297ae74771 window: Replace 'winsys_id' for monitor matching
Instead use an abstract "logical monitor id" that is generated from the
logical monitor. Instead of using low level numbers from the mode
setting devices, use either data from the EDID, or the connector, if the
EDID is not useful.

This should help with windows remembering monitor positions when the
same monitor reappears but with another mode setting device ID.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3753>
2024-06-04 16:09:50 +00:00
Carlos Garnacho
ad60d7123b Revert "wayland: Add meta_wayland_seat_get_input_focus_client() call"
This reverts commit 743fb6df30.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
2024-06-03 09:51:30 +00:00
Carlos Garnacho
b968796f1f wayland: Fix possibly out of sync clipboard selections
Replace the sync_focus() calls with a set_focus() do-it function taking
a surface. This is in line with the rest of the things that happen at
the default MetaWaylandEventInterface.focus implementation, and will
make these correctly observe the presence of grabs, since
meta_wayland_seat_get_input_focus() will return the would-be focus
in these cases.

This change makes the "focused" client selection truly
in sync with the keyboard focus.

Fixes: 5ca10c31d1 ("wayland: Follow seat's input focus client for clipboard selections")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3490
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
2024-06-03 09:51:30 +00:00
Carlos Garnacho
9dab806a18 wayland: Fix possibly out of sync primary selections
Replace the sync_focus() calls with a set_focus() do-it function taking
a surface. This is in line with the rest of the things that happen at
the default MetaWaylandEventInterface.focus implementation, and will
make these correctly observe the presence of grabs, since
meta_wayland_seat_get_input_focus() will return the would-be focus
in these cases.

This change makes the "focused" client selection truly
in sync with the keyboard focus.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3498
Fixes: 9bdb00c459 ("wayland: Follow seat's input focus client for primary selections")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
2024-06-03 09:51:30 +00:00
Georges Basile Stavracas Neto
bc7134cab3 cogl: Remove CoglOutput
Begone!

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
cb4190616f cogl/xlib-renderer: Use SubpixelFormat enums directly
No need to convert from / to CoglSubpixelFormat.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
4f3631eae4 cogl/xlib-renderer: Don't override subpixel order
This function goes to great lengths to convert an Xlib SubpixelFormat
enum into a CoglSubpixelFormat, then immediately discards that.

Fixes 88d8bd84f2

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
2a9576c59c cogl/xlib-renderer: Plug some leaks
Found them while reworking this file. XRRFree*Info() fully free the
pointers inside the infos, they're more appropriate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
64d0e503ff cogl/xlib-renderer: Copy CoglOutput struct
Since CoglOutput is strictly only used internally by Xlib and GLX,
copy it in place and use it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
c9e22d9f79 cogl/xlib-renderer: Return refresh rate directly
Instead of a CoglOutput that is then only used to fetch the refresh
rate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
653ba4a7a7 cogl/renderer: Move output list to CoglXlibRenderer
It's the only place where it's used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
94d69c3252 cogl/onscreen-glx: Store refresh rate directly
Instead of the CoglOutput. This removes any necessity of refcounting,
and allows simplifying some code.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
c1c8a4ba09 cogl/output: Make it private to Cogl
Don't expose its headers, remove all getters, and move the rest to
cogl-output-private.h. Next commits will clean it up even more, but
for now, just make it private.

This will help next commits remove CoglOutput.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
1d0dc6d6d8 src/backends: Add MetaSubpixelOrder
An exact copy of CoglSubpixelOrder, without the Cogl dependency.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Georges Basile Stavracas Neto
3ba7f626ed cogl: Remove unecessary includes
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
2024-06-03 08:31:58 +00:00
Marco Trevisan (Treviño)
44c0c311ba clutter/clone: Do not use global transformation for scaling clones
When cloning an actor we were applying a global scale to it, based on
the size of the clone itself and of the cloned actor.

This implied that the transformed size of the clone was not the one that
was set, but it was taking taking in account the actor scaling too.
So in practice we were scaling it twice.

While this had no visual implications it indeed was causing troubles
when a ClutterClone was reactive because in such case only the scaled
area of the scaled clone was considered reactive.

Assume you had an actor of 100x100 pixels, scaling it to a clone of
50x50 pixels:
 - The scale applied to the clone was 0.5
 - The transformed size of the clone was: 25x25 pixels
 - The clone was reactive only in that sub-area

To avoid this, never touch the clone transformation matrix, but only
transform it at paint time.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2959>
2024-06-01 11:11:32 +02:00
Marco Trevisan (Treviño)
467746c8a7 core/context: Add typecheck guards to the public functions
In the shell side we ended up calling the wrong function [1] and mutter
didn't stop us from doing it, so add some type-check guards to ensure we
don't do similar errors again

[1] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3355

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3791>
2024-05-31 14:51:13 +00:00
Marco Trevisan (Treviño)
bcec6df78e cogl: Do not store the XVisualInfo
We were leaking one instance because _cogl_winsys_egl_context_created()
could be potentially be called twice (via cogl_display_setup() one as
part of cogl_renderer_check_onscreen_template() and the other when
called from clutter_backend_do_real_create_context()), and so we'd ended
up overwriting the reference we had.

However, we really didn't use it anywhere and once used to call the
relevant functions it's just useless.

So let's just keep it as local variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
0fda3ab8a1 backends/x11/backend-x11-nested: Cleanup the cursor renderer on dispose
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
6a04ea9a59 backends/input-settings: Clear the devices list on dispose
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
b630c3baa6 backends/backend: Clear egl object if any
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
de8691c7ff backends/color-store: Unify and simplify codepaths for profile ready
Just steal from the hash table all the times, and use autopointers
to cleanup if needed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
430e55a535 backends/color-store: Clarify the color profile ownership fixing the key leak
We were leaking the color profile path keys but also it wasn't clear how
the ownership was passed to the new hash-table, so let's just remove it
from the pending hash table and add it to the new one including the
expected reference.

This is safe because we were still adding a temporary extra ref to the
profile

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
c2cc26b370 backends/native/backend-native: Free the device path when stealing the device
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
ce1dd40f7b backends/native/thread: Unref the callback sources hashtable on finalize
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
f74a46d98d backends/remote-access-controller: Own and free the session managers
We were leaking the session managers list, but at this point I feel it
looks cleaner to also own it fully

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Marco Trevisan (Treviño)
c33a02dd32 backends/backend: Cleanup MetaDnd on dispose
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
2024-05-31 11:01:00 +00:00
Carlos Garnacho
b35129db61 wayland: Check focus surface to set a pointer cursor
The cursor was following the "current" surface (i.e. the logical
focus, unaffected by e.g. grabs), so MetaWaylandPointer was always
providing window cursors, just so the MetaCursorRenderer would maybe
discard them and show the compositor cursor instead. E.g. in the
presence of grabs.

This clear barrier between grabs being compositor business deserving
a compositor cursor, and non-grabs being client business turned a bit
blurrier in grabs-pt5 where "client" things like popups and DnD would
also involve grabs. The fixes in that regard in the branch went on
the lenient side, introducing situations where grabs do exist but we
are preferring client-side cursors anyways.

Fix this by making MetaWaylandPointer aware of grabs at the time of
updating the client-side cursor, by following the "focus" surface
(i.e. the effective focus, affected by grabs outside of MetaWaylandInput).
The focus surface and cursor will be updated on focus changes, also
induced by grab changes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3460
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3736>
2024-05-30 19:18:49 +00:00