1
0
Fork 0
Commit graph

12652 commits

Author SHA1 Message Date
Jonas Ådahl
f3a33e9bd1 x11-display: Make subwindow redirection call mode specific
This means that for X11 sessions we'll do it before any windows are
mapped, and before any plugin implementation is started. Doing it before
a plugin is started is important, because things that the plugin does
during startup can have consequences on how compositing on Xorg works.

For the Xwayland case, we'll do it relatively in the setup phase. It
appears to have been harmless to do it later in the post-opened signal,
but there is no harm in doing it as one of the earlier steps.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3089
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3329>
2024-07-25 19:56:19 +02:00
Sebastian Wick
682935fefa core/debug-control: Introspect it to export the dbus service with lg
by executing `global.context.get_debug_control().exported = true`.

This makes it possible to get access to the debug service without having
to start with `--enable-debug`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
2024-07-24 21:52:47 +00:00
Sebastian Wick
c974bcf4b2 core/debug-control: Enable HDR only via DebugControl and META_DEBUG_
This removes the experimental HDR property from the monitor manager and
unifies all the debug features in DebugControl.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
2024-07-24 21:52:47 +00:00
Sebastian Wick
2693cac83a clutter/color-manager: Add a method to get the default color state
This avoids re-creating new color states objects to the default state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
b1370a483e clutter/color-state: Add a way to query if fp16 is needed for storage
Some color states, currently only the ones with linear transfer
characteristics, need at least half float formats for storing components
of that color state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
6a2ce066b0 clutter/color-state: Add a helper to print the color state
And use it in MetaRendererNative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
1223f8df68 clutter/pipeline-cache: Return a copy of the pipeline
This means the pipeline can be manipulated after retrieving. This also
fixes a leak when adding pipelines to the cache, as we the pipeline
would take a ref, but when adding, we wouldn't clean up our own ref.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
3359b67686 clutter/color-state: Handle adding snippet to pipeline
While no functional changes right now, this allows us to add extra hooks
like adding uniforms.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Bilal Elmoussaoui
c65bb3b9ce cogl: Remove poll renderer
As it is only composed of idle callbacks now, replace
those functions where they are used

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Bilal Elmoussaoui
a7b87f250f cogl/renderer: Always try to use GLX_NV_robustness_video_memory_purge
It was always set to TRUE and mutter is the only user.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Ivan Kuzmenko
2c5f874eaa orientation-manager: Expose MetaOrientationManager to introspection
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3880>
2024-07-23 17:49:11 +00:00
Sebastian Wick
6d78ff9373 tests/kvm: Update the kernel repo remote to gitlab.freedesktop.org
The drm subsystem has been moving over to gitlab for some time now and
the old anongit.freedesktop.org remote is becoming unusable. Contains
the same repo with the same tags, so this shouldn't result in any
differences.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3896>
2024-07-23 11:10:04 +00:00
Jonas Ådahl
eb786b749c window: Add simpler meta_window_move_resize()
This one hides the place flags and gravity, which is irrelevant in many
places.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 21:25:37 +02:00
Jonas Ådahl
c7ddc839f1 window: Only deny focus if mostly overlapped with always-on-top window
Having an always-on-top window affects focus granting logic if the
to be showing window overlaps with any of them. Instead of triggering
the focus denying logic if a new window ever so slightly touches an
always-on-top window to only triggering if it's covered more than 60% by
always-on-top windows.

This is intended to make using always-on-top windows a bit less annoying
and not cause as many unintended focus-on-map denials.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 21:25:28 +02:00
Jonas Ådahl
74f58674e7 window: Don't check always-on-top overlap before placing
When we show a window, we'll check if it overlaps with an existing
always-on-top window with the intention to deny focus. However, we did
this potentially before having placed the window, meaning we effectively
checked as if it was placed at (0, 0), which created unexpected results.

Instead check the overlap state after placing. A window placement test
case is added to verify this works as expected.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 21:25:24 +02:00
Jonas Ådahl
c68d6c4958 window: Fix minor coding style issue
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
5e36e5aae1 window: Clarify expression for deciding whether to auto-maximize
Calculate areas and store them in descriptively named variables, and
then compare them, instead of doing it all in one go.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
d7daf50d62 window: Move required condition into main if statement in show()
No logical changes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
9ebbf83e95 window: Add place flags
Replace a boolean argument and a temporary MetaWindow struct field with
a `MetaPlaceFlag` passed where relevant. This includes
`meta_window_move_resize_internal()` and `meta_window_constrain()`, as
placement may happen during constraining, and also
`meta_window_force_placement()`.

The struct field (denied_focus_and_not_transient) was only ever set in
meta_window_show(), before meta_window_force_placement(), and
immediately unset as a side effect of that. In .._show() we'll always
force placement if the window wasn't already placed, and in
meta_window_constrain(), we'd only ever call meta_window_place() if the
window wasn't already placed, meaning the variable would only ever be
relevant during `meta_window_show()`. Having it as a flag makes that
relationship and temporary state clearer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
f4b79441fa tests/test-runner: Allow tweaking 'center-new-windows' pref
This will allow tests to test placement algorithms.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
d8cdc56ec4 place: Remove a couple of comments about X11 roundtrips
It's not relevant in the context where the comment is, and don't need to
be reminded of X11 quirks here.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
22533f8454 place: Move and clean up finding relevant windows
Split up the condition a bit, use an auto pointer for a list, and use
current convention for list iteration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
463c7ab989 window: Clean up formatting and naming of stacking adjustment condition
The function checking whether a 'always-on-top' window covers the
showing window now has that in the name, to make it more obvious. That
function was also changed to use the more common way of iterating a
list, and now uses auto cleanup pointers for the list.

The condition itself was updated to follow the current coding style.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
76e044c39d window: Include window title in debug description
Useful to reason about MUTTER_DEBUG=stack logs when using metatests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Bilal Elmoussaoui
6da869d575 cogl: Move has_feature to Context namespace
That is where it belongs anyways..

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3895>
2024-07-22 13:06:33 +02:00
Daniel van Vugt
21bc7432dc onscreen/native: Squash adjacent switch statements
Because we can. And it's now clearer that `buffer` is only used in
`META_RENDERER_NATIVE_MODE_GBM`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3891>
2024-07-18 17:37:06 +08:00
Daniel van Vugt
c4d0e970dc onscreen/native: Move next_frame storage to later in the function
It won't be used until later when we flip, and in fact assigning
it early could have led to its own assertion failing on the next frame
in the unlikely event that we return with "Failed to ensure KMS FB ID...

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3891>
2024-07-18 17:26:38 +08:00
Jonas Ådahl
288d57f6a5 window: Propagate stickyness across modal dialog chains
While marking a parent window as sticky or non-sticky always propagates
to the children, also propagate to the parents if the dialog in question
is modal.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
c079e2696d tests/test-runner: Add (un)set_modal
Ends up calling gtk_window_(un)set_modal() in the client.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
9628806b37 window: Ignoring unmanaging ancestor when finding root
This avoids the following critical warning happening sometimes when a
Wayland client exits taking all its window with it in an arbitrary
order:

    CRITICAL: meta_window_set_stack_position_no_sync: assertion 'window->stack_position >= 0' failed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
d80f1944ef tests: Add tests for stickyness
The test tests how sticky windows and their transient-for dialog windows
behave together.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
b206e146ea tests/test-runner: Add stick/unstick commands
These can be used to toggle the "showing on all workspaces" state.

An assertion for checking stickyness was added too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
559bdefcc7 tests:test-runner: Add 'assert_stacking_showing'
This, in contrast to 'assert_stacking' only checks showing windows. This
is useful when doing workspace tests, where one want to check what
windows are currently visible.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
7b8558ef9a window: Inherit stickyness from parent when becoming transient
When a transient window becomes transient, check if the parent is
sticky, and if it is, make the transient sticky as well. This handles
situations where e.g. a utility dialog (such as search and replace) is
opened on a sticky window, also making the utility dialog sharing the
same stickyness state.

This is also more in line with the semantics of making a window sticky,
where transient would implicitly become sticky as a side effect.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Jonas Ådahl
2466b9accb window: Don't switch workspace on sticky transient when activating
If a transient window is sticky (visible on all workspaces) and it gets
activated, we'd call move_worskpace() which would effectively unstick
it, which is rather unexpected. It'd also effectively unstick its parent
as well, due to moving a transient window also moves its descendants and
ascendants.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
2024-07-17 15:25:52 +00:00
Peter Hutterer
d9ead043c7 backends: Add support for tablet tool pressure ranges
Introduced in libinput 1.26 this feature allows restricting the
tablet tool pressure range to a subset of its physical range. The
use-case is either to require some higher-than-usual minimum pressure
before the pen reacts, or lower-than-usual pressure to reach the maximum
logical pressure.

libinput takes a [0.0, 1.0] normalized range which we expose as percent
in the gsettings. The wacom driver doesn't have an exact equivalent but
it has a Threshold setting (range [1, 2048]) that defines when a button
is generated for tip down.

See gsettings-desktop-schemas!84

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3794>
2024-07-16 12:05:13 +02:00
Peter Hutterer
d65c89d8b9 core: Add a MetaToolActionMapper for tablet tools
This mapper hooks into CLUTTER_BUTTON_PRESS/RELEASE events with a
clutter button of zero but a nonzero evcode (e.g. BTN_STYLUS).
It then looks up the available button actions and implements
switch-monitor and keybindings using the MetaTabletActionMapper parent
class.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
7e7a9322fa backends: Expose the tool button mapping via InputSettings
Unlike most other schemas the path for a tool requires a bit of
processing (serial number or tablet vid/pid if there's no serial number).
Let's make the tool settings available through the MetaInputSettings
instead of having to duplicate that path composition in the caller.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
7ab5a8cf95 backends/native: Handle new stylus actions as zero button events
Stylus actions that don't map into LMR or back/forward are now created
as a clutter button event with a button number of zero. Nothing is
actually done with those events for now, they're just discarded later.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
829adfcfaa backends/native: Store the stylus actions as actions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
5fdf1fa892 backends/native: Apply stylus button mappings before anything else
For stylus buttons we apply a button mapping, e.g. secondary button ->
right. This mapping was previously applied to the clutter event's evdev
code only, not the actual clutter button. As a result, gnome-shell would
always treat the BTN_STYLUS as middle and BTN_STYLUS2 as right,
regardless of the mapping.

Move the mapping up so we first adjust our evcode, then proceed with
the usual mappings.

Note that this temporary breaks the stylus mapping to Back/Forward which
will be fixed in a follow-up commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
ae59acad76 backends/native: Use helper functions to map buttons
Use the helper function for mapping a stylus tool evdev code to a
clutter button code. This fixes a (theoretical) issue - if a tool were
to send any button other than the one we handled those would likely be
BTN_SIDE and friends and we'd likely end up with negative button
numbers. The BTN_TOOL_PEN range is not predicable enough to do any sort
of calculation conversion because things like BTN_TOOL_DOUBLETAP have
specific meanings that aren't actually buttons.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
dfcb160321 backends: Add helpers to convert from clutter tool button to evcode
This complements the existing clutter->evdev and evdev->clutter helpers,
but this time for buttons we expect from a stylus tool. We also need to
convert left/middle/right for the Wacom puck/lens cursor tools but that
particular conversion is lossy.

Note that these are more restrictive than the normal codes - if we
get "other" buttons from a stylus we don't really know what they could
possibly map to. So we safely map what looks like buttons from a mouse
but otherwise complain and return zero.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
6c77af1493 core: Add a MetaTabletActionMapper as parent of the MetaPadActionMapper
This is prep work for using the same functionality for tablet tools as
well. The new MetaTabletActionMapper takes care of the event bubbling
via the device-added/removed and input-event signals and provides the
helper functions to cycle outputs and/or emulate keybindings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Sebastian Keller
31e027d1b1 edid: Ensure strings owned by MetaEdidInfo are freed
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3888>
2024-07-16 03:37:02 +02:00
Sebastian Keller
a541aa9a8c edid: Fix di_info leak after we are done parsing
This was only affecting builds using libdisplay-info.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3888>
2024-07-15 23:52:31 +02:00
Bilal Elmoussaoui
f5c376e860 cogl: Move PrimitiveTexture functions to Texture
Since the move to GObject for CoglTexture, CoglPrimitiveTexture was
removed. So drop remaining of that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3885>
2024-07-15 21:42:38 +02:00
Bilal Elmoussaoui
9ee1a0fc34 cogl: Expose Renderer.get_proc_address
Allows to get rid of the cogl_get_proc_address

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
2024-07-15 14:39:23 +00:00
Bilal Elmoussaoui
b3ae934304 cogl: Pass Context to cogl_flush
Avoids using the global variable & also move the function to
it proper context

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
2024-07-15 14:39:23 +00:00
Bilal Elmoussaoui
194fa80cdd cogl: Pass a Context param to winsys_has_feature
Avoids using the global variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
2024-07-15 14:39:23 +00:00