1
0
Fork 0
Commit graph

30296 commits

Author SHA1 Message Date
Niels De Graef
019267a044 tests/test-runner: Don't leak tests array
Make sure we properly free the array and its string elements

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2817>
2023-02-01 13:16:29 +00:00
Niels De Graef
1a814250c0 tests/meta-context-test: Free D-Bus call results
Don't leak the resulting `GVariant`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2817>
2023-02-01 13:16:29 +00:00
Robert Mader
678bc69e72 clutter/frame-clock: Clamp next_update_time to the current time
Calculating a timestamp from the past distorts the dispatch lateness
calculation, leading to an inflated max_render_time, which again
increases the likelyhood of next_update_time being in the past.

Fixes 99850f4645

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2819>
2023-02-01 12:21:44 +00:00
Jonas Ådahl
be649bdad2 tests/native-pointer-constraints: Remove extra semicolon
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
2c15a9569e tests/cogl: Remove extra semicolon
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
a811a93102 onscreen/native: Remove extra semicolon
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
0662ed51f9 monitor-manager: Remove extra semicolon
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
e97c7851d3 onscreen/native: Also track privacy screen KMS state here
As with GAMMA_LUT, track whether privacy screen state has been pushed to
KMS in the onscreen. This leaves MetaOutput and MetaCrtc to be about
configuration, and not application.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
24bdafa220 onscreen/native: Track GAMMA_LUT invalidations here
We only know if changing the GAMMA_LUT has happened if we sent away a
KMS update that succeeded. Concentrate this state tracking to the
onscreen.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
beb6903397 output/kms: Make set privacy screen caller handle the update
As with CRTC GAMMA_LUT, we're moving towards making the entity managing
KMS updates aware if there are any changes to be made, and whether KMS
updates are actually needed or not, and for privacy screen changes, this
means we need to communicate whether the privacy screen state is valid
or not. This allows the caller to create any needed MetaKmsUpdate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
589c833e5f crtc/kms: Make set gamma caller handle the update
We're moving towards making the entity managing KMS updates aware if
there are any changes to be made, and whether KMS updates are actually
needed or not, and for GAMMA_LUT changes, this means we need to
communicate whether the GAMMA_LUT state is valid or not. This allows the
caller to create any needed MetaKmsUpdate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
ee91655f7d output/native: Set privacy screen KMS state in prepare-frame
This makes it behave the same as the gamma look up table of CRTCs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
8e7ada70a5 renderer/native: Make onscreen handle setting gamma
It's state that is part of the onscreen/CRTC, so move it there.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Jonas Ådahl
2f39f759c2 kms/update: Remove API to remove result listener
Its use have been replaced with creating and adding state to an update
only when it's expected to be posted.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2814>
2023-02-01 08:40:53 +01:00
Evan Goode
0742170062 Support selecting an acceleration profile for touchpad devices
Signed-off-by: Evan Goode <mail@evangoo.de>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2426>
2023-02-01 03:03:47 +00:00
Kukuh Syafaat
f08dc7a4ec Update Indonesian translation 2023-02-01 02:45:10 +00:00
Carlos Garnacho
35e7feac8c wayland: Check that the current backend is native before using DMA-BUF FDs
We may fall through these paths on --nested too, resulting in us poking the
wrong internals from the wrong MetaRenderer subclass. Fixes launching of
clients using wl_drm in --nested.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2818>
2023-01-31 11:08:26 +00:00
Robert Mader
51735c218b screen-cast/window/src: Fix on_prepare_frame signature
To unbreak window screen-casts.

Fixes 08b0e563

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2816>
2023-01-31 02:22:49 +01:00
Jonas Ådahl
49b0a8921c Use g_clear_fd() instead of open coding the same behavior
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2806>
2023-01-30 15:11:26 +00:00
Jonas Ådahl
f34c6da956 build: Depend on glib 2.75
This allows us to use g_clear_fd().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2806>
2023-01-30 15:11:26 +00:00
Simon McVittie
ca70c1dfb5 tests: Break up stacking installed-tests into more, smaller tests
Running each stacking test as a separate installed-test is analogous to
what was done for build-time tests in c6d1cf4a (!442) and should make it
easier to track regressions, by being able to see whether a regression
is specific to one .metatest script or applies to more than one.

Signed-off-by: Simon McVittie <smcv@debian.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2773>
2023-01-30 14:39:39 +00:00
Emin Tufan Çetin
d14667c4bc Update Turkish translation 2023-01-30 13:38:07 +00:00
Jonas Ådahl
e2ddf2055c screen-cast/src: Log the type of frame recorded
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
2023-01-30 13:17:19 +00:00
Jonas Ådahl
e8e8a63054 core/delete: Avoid warnings when there is no close dialog
The "ensure dialog" function didn't ensure there was a dialog created,
so the function was renamed. The callers was updated to handle the
dialog not being created.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
2023-01-30 13:17:19 +00:00
Jonas Ådahl
0f4e0cfd52 stage-view: Fix header include guard
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
2023-01-30 13:17:19 +00:00
Jonas Ådahl
8137c47cc6 color-store: Forward cancelled error if connect failed
Otherwise the task will remain unfinished despite we cancelling it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
2023-01-30 13:17:19 +00:00
Jonas Ådahl
b712a7e455 cogl/egl: Also log when we managed to obtain a high priority context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
2023-01-30 13:17:19 +00:00
Jonas Ådahl
64c3b824fa tests/clutter: Use a dummy actor for some interactive tests
While completely untested, at least this makes it work "in theory"
again. Before it'd listen to signals on the stage, but have an incorrect
type signature to handle the test paint procedures, meaning it'd
probably crash or cause memory corruptions.

What was needed was a signal which in the callback the test could call
some cogl functions to paint on the framebuffer. While there is no such
signal on the stage, and the ClutterActor::paint signal (which they
probably used in the past) is long gone, lets add a "test actor" that is
just a wrapper that adds that paint signal with a paint context.

The tests that need it are changed to add this actor to the stage, and
to listen to the paint signal on the actor instead of incorrectly
listening on stage signals.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
2023-01-30 13:17:19 +00:00
Carlos Garnacho
48dc8073de core: Drop META_GRAB_OP_GET_BASE_TYPE define
This was only left used to know whether a MetaGrabOp was about
a window drag operation, but all grab ops are about windows now.
This is redundant.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
c6d23f67f0 compositor: Move tiling preview management to MetaWindowDrag
And release MetaDisplay from handling this management. Window tiling
previews are only triggered from window drags, and are implicitly tied
to them.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
f04d84de65 compositor: Move edge resistance data to MetaWindowDrag
At least indirectly, this is set as object qdata while the
window drag is ongoing, and reset/reconstructed if needed.

Consequently, this edge data does not need to be stored in
the MetaDisplay struct anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
675d0df09b compositor: Make cleaning cached edges go through MetaWindowDrag
Even though the data is still stored in the display, add a "high
level" meta_window_drag_update_edges() call, so that the cached
edges may be updated while a window drag operation is ongoing.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
60f11e419f compositor: Pass MetaWindowDrag to edge resistance functions
This code will be poked exclusively from the MetaWindowDrag, so
change the API to start passing this object around.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
36bda45888 core: Move edge-resistance handling to src/compositor
This is now something that is mainly handled from the compositor
side, so it makes sense to move it there. Following commits will
cut all ties with src/core.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
e88891a1d5 core: Cleanup header includes
There's some X11 includes we no longer need in these files.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
d687e5634d core: Pass device/sequence on meta_window_begin_grab_op()
This is a public API change. Add device/sequence parameters to this
operation, so that window dragging and resizing can stick to one
set of pointing events of them all.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
18535928e7 wayland: Add device/sequence out parameters getting wayland grab info
This information will become necessary for window move/resize ops.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
f2ff317206 core: Drop unnecessary code
This is already handled by the meta_compositor_grab_begin/end
calls, for the Wayland cases.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
b2ebe9c262 core: Move accounting of "shaken_loose" to MetaWindowDrag
It's entirely accessed from there (besides reset and initialization),
so can be completely taken there.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
39f1b6dca0 core: Delete now unused code
Since MetaWindowDrag took a lot of this code to handle window drags
internally with less interactions with the rest of the stack, this
code in display/window/keybindings is unused.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
bec8a5860a core,wayland,compositor,x11: Migrate to MetaWindowDrag
Flip the switch in using MetaWindowDrag, leaving display grab
ops and a bunch other code unused. Some places checked the grab op
and/or window in complex ways, others just checked for grab existence
and should now look for clutter ones, and others already were already
doing this in addition.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
db1c64fe06 compositor: Add window/grab_op getters to MetaWindowDrag
This will be useful in porting, since there's still places that
check the current grab operation, or check a window against the
currently dragged window.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
fc4287cd20 compositor: Add high level API to deal with MetaWindowDrag
This helper object (and the whole window drag operation) will be
requested to the compositor instead of created directly, and only
one of those can exist at a time, so the compositor will also
safeguard that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
e6d0e0fda6 compositor: Add method to update MetaWindowDrag after resizes
Since SSD X11 windows require synchronization between frame and client
windows on resizes, updates do not always happen immediately but in
control of external factors (i.e. when both windows become to have
a coherent size).

This method will be used to update the window position between
resize/sync operations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
14006adf6f compositor: Handle pointing events in window drags
This code is largely copied from src/core/window.c, taking care
of pointer/touch interaction during window drag operations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
dd3e5d2b52 compositor: Handle keyboard events in window drag operations
This is code largely copied from src/core/keybindings.c, taking
care of keyboard interaction during window drag operations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
d8f6b4be9b compositor: Add MetaWindowDrag helper object
This compositor-side object will single-handedly drive a window
drag operation. Currently, this largely copies meta_display_begin_grab_op
and meta_display_end_grab_op, except grabbing is done through a
ClutterGrab instead of direct meta_backend_grab_device() calls. This
also means that the switch from passive to active keyboard grabs is
handled differently.

Currently, this object is dormant. It requires moving more code from
other places to become a fully functional replacement.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
49cc761aaf core: Drop unused includes
This file does not do anything directly related to X11 inside it,
these headers are no longer necessary.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
58e88fc8db core: Simplify grab tracking
We only allow partial grabs in the case of a keyboard-type MetaGrabOp
happening while the pointer cannot be grabbed. In that case, it's not
a big stretch to unconditionally ungrab the pointer device at the time
of undoing the grab, as it will be always ineffective (not even implicit
grabs on frame windows can happen now, inside Mutter).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00
Carlos Garnacho
452e4f4801 core: Drop MetaX11Display ungrab before MetaDisplay grabs
This is no longer necessary, since the SSD frames are no longer
part of Mutter process, so it is not the MetaX11Display connection
which holds the implicit grab when a mouse button is pressed over
a window frame (say, to start a drag).

As the SSD frames client communicates the same way than CSD windows
for window operations, it is also expected to undo its implicit
grab before requesting a window move/resize operation.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
2023-01-30 10:56:29 +00:00