1
0
Fork 0
Commit graph

31981 commits

Author SHA1 Message Date
Sebastian Wick
8709fc5353 wayland: Bump connection buffer size to 1MB
Let's increase the connection buffer size a bit to avoid killing
clients which stall just for a few ms when they receive high
frequency input updates.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3693>
2024-06-13 11:58:14 +00:00
Jonas Dreßler
530659c643 tests/clutter/conform: Wait for stage update right after showing stage
Showing the stage always results in an initial update being queued. If the
virtual input events from the test ends up being dispatched after that, the
`wait_for_update()` checks gets out of sync, as the first update ended up
waiting for the initial update, not the one from the input event.

Fix the gesture test by adding another call to `wait_stage_updated()` right
after `clutter_actor_show()`.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3521
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3795>
2024-06-12 18:45:29 +00:00
Bilal Elmoussaoui
408cb6ee57 clutter: Drop Color.to_pixel
Keep the function around as Color.hash

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3802>
2024-06-12 16:25:18 +00:00
Bilal Elmoussaoui
74ece2ad92 clutter: Drop various Color constructors
The fields are writable, there is no need to provide a custom constructor.
This shapes the Color API to be similar to GdkRGBA

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3802>
2024-06-12 16:25:18 +00:00
Bilal Elmoussaoui
04842393aa clutter: Drop Color.from_pixel
Goes along with https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367
Helps https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3544

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3802>
2024-06-12 16:25:18 +00:00
Jonas Ådahl
9d11cc679e screen-cast/window: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-12 15:11:04 +00:00
Jonas Ådahl
897c535bd8 screen-cast/monitor: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-12 15:11:04 +00:00
Jonas Ådahl
dd8a503f3d screen-cast/area: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-12 15:11:04 +00:00
Jonas Ådahl
bbd59ab9e6 screen-cast/virtual: Only record cursor updates if anything changed
If we're doing a cursor-only update, only actually do it if anything
changed relative to the stream itself.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3220
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-12 15:11:04 +00:00
Jonas Ådahl
91d43bfbe1 screen-cast/src: Allow dropping cursor-frame if nothing changed
Allow a screen cast stream source to say that nothing changed in terms
of cursor metadata, and treat this together with a cursor-only frame as
we not recording anything.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3803>
2024-06-12 15:11:04 +00:00
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