Commit Graph

30711 Commits

Author SHA1 Message Date
Robert Mader
dfd58ca8f1 clutter/actor: Extend caching in apply_relative_transformation_matrix
Apart from a few edge cases we can avoid walking the tree and transform
to the ancestor coordinate space by multiplying the actor stage-relative
matrix with the inverse of the ancestor's stage-relative matrix.

Since the stage-relative matrices are cached, this reduces the number of
matrix multiplications we do in many situations considerably.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3259>
2023-09-12 10:16:58 +00:00
Ask Hjorth Larsen
47d4613ce7 Updated Danish translation 2023-09-11 21:12:37 +02:00
Christian Kirbach
87f5254d51 Update German translation 2023-09-09 07:09:32 +00:00
Anders Jonsson
c1a3d29b14 Update Swedish translation 2023-09-07 20:11:58 +00:00
Carlos Garnacho
89e11e8335 clutter: Fix source device in crossing ClutterEvents
This used to be the HW device that triggered the crossing (i.e.
the mouse moving the pointer, etc), or the logical device if the
crossing event happened through other means than input device
events, e.g. relayouts.

The move to ClutterEvent constructors went a bit too far in
the simplifications and broke these expectations for input-generated
crossing events.

Make this event constructor behave like the other events: receive
a source device, and figure out the corresponding logical device from
there. Also pass the source device as it'd be expected, in the
input-induced crossing event generation paths.

Fixes: a8c62251f8 ("clutter: Port stage crossing events to new constructors")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2981
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3256>
2023-09-07 17:01:30 +00:00
Quentin PAGÈS
162d73c049 Update Occitan translation 2023-09-07 16:37:20 +00:00
Sabri Ünal
8996d653b4 Update Turkish translation 2023-09-07 10:32:19 +00:00
Daniel van Vugt
c7815f33a2 backends/x11: Trap errors from XIAllowTouchEvents
And report them as debug messages instead of crashing. We don't want them
to be visible usually because failures are expected in the autodeny
code path.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2808,
        https://launchpad.net/bugs/2029413

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3253>
2023-09-07 15:04:55 +08:00
Carlos Garnacho
80e15775a5 compositor: Fix surface accounting at MetaWindowActor
When the actor gets a new "main" surface assigned, it adds the
new surface to the stack of surface actors, but forgets to remove
the old one.

This stale pointer in the array may cause invalid reads and crashes
after the assigned surface is disposed, e.g. when destroying the
MetaWindowActor tries to disconnect signals from all accounted
surface actors.

Fixes: 9a2c8b2592 ("window: Add suspend state")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3252>
2023-09-06 18:13:00 +02:00
Joan Torres
33eef7211a launcher: Fix unrefing seat_proxy
When using meta-laucher headlessly, there isn't a seat_proxy.
In that context, doing directly g_object_unref gives an error.
This commit fixes it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3249>
2023-09-06 13:02:30 +00:00
Florian Müllner
bc74d166dd window: Really fix portrait orientation check for tiling
Commit 3bfcb6d1 fixed the check for tiling via keybindings, but
ignored a subtle edge case when tiling with the pointer: The
monitor used for tiling is the monitor with the pointer, which
is not necessarily the one that contains the largest part of the
window.

That is, the correct monitor to check against depends on the
context where the function is called. We can either figure
it out automatically via the current window drag, or make it
a parameter.

The latter is clearer, because the callers already decide which
monitor to use for tiling anyway.

Fixes: 3bfcb6d1b9 ("window: Fix portrait orientation check for tiling")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3248>
2023-09-06 12:36:57 +00:00
Florian Müllner
493e799398 Bump version to 45.rc
Update NEWS.
2023-09-06 13:58:21 +02:00
Bruce Cowan
704ea14990 Update British English translation 2023-09-06 11:48:53 +00:00
Carlos Garnacho
a6bda759f9 wayland: Do not trigger focus sync when destroying data offers
These objects are tied to the keyboard focus lifetime, but do not drive
it in any way. There is likewise no need to synchronize Wayland focus
when those are destroyed, that will be triggered through crossing events,
surface destroy notifications, etc...

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2993
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3246>
2023-09-06 10:55:55 +00:00
Daniel van Vugt
7c8f1b4cc0 compositor/multi-texture-format: Cache snippets
These snippets are retrieved anew every time a window is resized. But
callers never modify them, they're effectively read-only so cache them
at the place of creation.

This is required to convince the pipeline hash that each reuse of the
same snippet really is the same snippet and so the pipeline is unchanged.
`CoglPipelineSnippetList` only does shallow comparisons and there's no
need right now to reimplement it as a deep comparison.

This eliminates the log message:

> Over 50 separate %s have been generated which is very unusual,
> so something is probably wrong!

which isn't actually a leak but more a warning about wasting time.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6958
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3224>
2023-09-06 10:26:48 +00:00
Carlos Garnacho
6427b5b1f6 backends/x11: Prevent uneven error traps init/deinit on GInitable failure
GInitable initialization is failable, currently, it may fail before error
traps are initialized, but error traps would be invariably deinitialized on
finalize() of the failed object. This results in an assert hit, on top of the
original failure to initialize the backend.

The libX11 error handlers are a pure client-side construct, and not a server
request, they just need XInitThreads() called to set up the library-side locks
protecting access to the global variable. This is done beforehand already at
meta_backend_x11_init(), so initialize the error traps around that time too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3242>
2023-09-06 10:03:21 +00:00
Carlos Garnacho
cc874f5d33 x11: Avoid poking MetaCompositor during MetaDisplay destruction
Commit 9c3b130f67 changed slightly destruction order to handle use-after-free
situations, but missed a small new one introduced by the order change: The
MetaX11Display may schedule callbacks through MetaLaters, which depend on the
MetaCompositor, which is now freed before the MetaX11Display.

Since there is no winning move here, make the MetaX11Display aware of this
by avoiding to remove the callback if the MetaCompositor is already gone.
The MetaLaters infrastructure is already fully freed at this point (incl. the
data it contained), so this shouldn't be a leak.

Fixes: 9c3b130f67 ("display: Fix destruction order")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3247>
2023-09-06 09:28:09 +00:00
Gwan-gyeong Mun
971babfccc Update Korean translation 2023-09-06 04:18:16 +00:00
Uzair Ahmad
3bfcb6d1b9 window: Fix portrait orientation check for tiling
Use work area from the monitor that the window is currently on to
determine if tiling should be allowed.

Window tiling is disabled for monitors with portrait orientation, but
the work area we use to detect portrait orientation is taken from the
monitor that currently has the mouse pointer.

This works fine for edge tiling using the mouse, but this is broken when
using keybindings for window tiling because your mouse pointer could be
on a different monitor that has horizontal orientation.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3199>
2023-09-05 20:13:48 +00:00
Bilal Elmoussaoui
81a12a7db4 cleanup: Replace cairo_matrix_t with graphene_matrix_t
Reduce cairo usage where graphene can do a much better job

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3243>
2023-09-05 18:25:49 +00:00
Jeremy Cline
379996a63e onscreen/native: Check frame_info for null in finish frame callback
While adjusting the monitor layout of my docked laptop, mutter got a
segfault while attempting to dereference the frame_info struct. This
happened on gnome-shell 44.4-1.fc38.

cogl_onscreen_peek_head_frame_info() just forwards the call to
g_queue_peek_head() which returns NULL in the event that the queue is
empty. If finish_frame_result_feedback() is expected to always be called
with a non-empty queue there's still a bug somewhere, but regardless
this API can legitimately return NULL so it should be checked for prior
to dereferencing.

Fixes: 61801a713a ("onscreen/native: Avoid freezing the frame clock on failed cursor commits")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3229>
2023-09-05 16:26:49 +00:00
Yaron Shahrabani
fb640783e8 Update Hebrew translation 2023-09-05 13:23:57 +00:00
Jonas Ådahl
fddcf8ca91 renderer/native: Don't drop disable-only mode set updates
If we are making an update that only disables CRTCs, we would not
actually post it, but just drop it then post nothing, as it wasn't ever
added to the mode set update hash table. This resulted in hotplugs where
we loose the all the connectors we had, where we want to disable all
CRTCs and enable nothing, to fail to disable said CRTCs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3073>
2023-09-05 12:41:41 +00:00
Milo Casagrande
20d0dcd800 Update Italian translation 2023-09-05 11:39:32 +00:00
Philipp Kiemle
6b2a30c9d0 Update German translation 2023-09-04 18:11:09 +00:00
Jonas Ådahl
15a3c47df5 eis: Rebuild absolute pointers when any viewport changes
This fixes remote desktop client side resize via changing virtual
monitor stream sizes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3241>
2023-09-04 12:14:42 +02:00
Jonas Ådahl
1a1a16324b remote-desktop/session: Only add configured streams as viewports
This means they will have a valid size/position. This makes absolute
pointer events work on virtual monitor streams again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3241>
2023-09-04 12:14:42 +02:00
Jonas Ådahl
264d29b435 screen-cast/session: Use add_stream() helper everywhere
It was introduced, but using it everywhere appropriate was forgotten.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3241>
2023-09-04 12:14:42 +02:00
Jonas Ådahl
242737c4dc screen-cast/stream: Add 'is-configured' property
When this is TRUE, it has a size, position etc. Only virtual streams do
this asynchronously, as they go via monitor configuration after being
created.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3241>
2023-09-04 12:14:42 +02:00
Jonas Ådahl
731c3e0ba3 screen-cast/stream: Keep track of object properties
This will make it possible to emit notify events without going via
strings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3241>
2023-09-04 12:14:42 +02:00
Barnabás Pőcze
9c3b130f67 display: Fix destruction order
MetaCompositorX11 might need the MetaDisplay's x11_display
during shutdown (meta_sync_ring_destroy -> meta_sync_free),
and `meta_display_shutdown_x11()` needs the MetaStack as
it calls `meta_stack_{freeze,thaw}()`. So fix the order
of destruction so that dependencies are destroyed
after dependants.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2852
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3202>
2023-09-03 23:31:37 +02:00
Barnabás Pőcze
d6b3679bd3 core: Subscribe to stack changes in the stack-tracker
This removes the implicit dependency on `display->stack_tracker`
existing and being valid in `on_stack_changed()` because
now it is the stack-tracker's responsibility to subscribe
to the "changed" signal of the stack and handle the changes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3202>
2023-09-03 23:31:37 +02:00
Carlos Garnacho
af10ead918 x11: Find nearest input affecting _NET_WM_MOVERESIZE X11 requests on Wayland
The _NET_WM protocol, written before the birth of XInput 2.x, does have
no notion of different input devices whatsoever. Anyways, in a X11 session
it is safe to assume this refers about the Virtual Core Pointer since
every input device by default drives it (incl. touchscreens through the
"pointer emulating sequence", and styli).

This assumption falls apart in a Wayland session with non-pointer input,
since we do actually distinguish between all the distinct pointer devices
and touchpoints, and do not let them emulate mouse input.

We do need to specify a device/sequence there to drive the window
move/resize operation. The _NET_WM_MOVERESIZE message just gives us the
x/y root coordinates the resize was started from, so work from there
into guessing what is the most likely device/sequence that did trigger
the request on the client side.

Conversely, on Wayland we do not need to check for possible race
conditions in the pressed button states since we have larger guarantees
about not missing these events if we checked for the button modifier
mask beforehand, so make that race condition check specific to the
X11 sessions.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2836
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3059>
2023-09-03 20:59:16 +00:00
Carlos Garnacho
4269f85bcc clutter: Add stage method to iterate over active input
The stage has the knowledge about input that is ongoing over it
(incl. things like styli and touchpoints). Add an iterator API
for these devices/touchpoints, so they can be used for calculations
and heuristics in other places of the code.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3059>
2023-09-03 20:59:16 +00:00
Jonas Ådahl
7c2453cd8c screen-cast/stream-src: Fix min/max framerate typo
The min was set to the max, and the max was set to the min, making
virtual monitors refresh rate very very slow.

Fixes: 215b91a2e6 ("screen-cast/src: Consider preferred format for stream")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3239>
2023-09-03 22:19:23 +02:00
Jonas Dreßler
e303551745 backend: Ignore events without source_device for pointer visibility
There can be events which don't not have source devices set on them, because
they are not backed by real hardware and rather generated by us, for example
IM events coming from the shell's OSK.

So don't assume all events have a source device in
update_pointer_visibility_from_event() and rather ignore those without one,
as we are only interested in events coming from "real hardware" here.

This fixes an issue where the mouse pointer would appear on devices without
any input from actual mice/touchpads on OSK key presses.

Fixes: 6aa42d6dad
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3236>
2023-09-03 19:38:07 +00:00
Jonas Dreßler
aa6888e6bd clutter/event: Set logical input device for IM events
So far, we expected all events to have input devices set on them, IM events
lost theirs with commit 6aa42d6dad. This somewhat made sense, because IM
events are not backed by any actual device, they are generated by us in
response to eg. an OSK key press.

To fullfil the assumption that all devices at least have a logical input
device set, pass the seat to the clutter_event_im_new() constructor and then
set the device to the logical keyboard device. The source_device we leave
empty, since there is no actual physical device that this event came from.

Fixes: 6aa42d6dad
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3236>
2023-09-03 19:38:07 +00:00
Nathan Follens
e0ccbcb44d Update Dutch translation 2023-09-03 13:48:53 +00:00
Jonas Dreßler
540cdc0d93 clutter/stage: Don't set implicit_grab_cancelled to TRUE if there are none
The assertion for !implicit_grab_cancelled in the
`grab_actor == old_grab_actor` case of
clutter_stage_notify_grab_on_pointer_entry() is meant to do a simple
sanity-check to ensure the grab machinery is working as intended: During a
seat grab, all input gets delivered to the tree inside the grab, and all
implicit grabs outside of that tree are cancelled.

When a new seat grab on the same actor as the existing one happens, we run
through the cancellation machinery for implicit grabs anyway, so we might as
well check that the assumption mentioned above holds true: By asserting that
no implicit grabs were cancelled, we know that no implicit grabs exist
outside of the existing seat grab tree.

This assertion is slightly over-eager though due to the way we set
implicit_grab_cancelled: We initialize it to TRUE in the
entry->press_count > 0 case and then only set it to FALSE once we find an
implicit grab that may remain active. If there are no implicit grabs though
(while entry->press_count is still >0), we never set implicit_grab_cancelled
to FALSE, triggering the assertion in question even though no implicit grabs
got cancelled.

There's two possible solutions for this: Either dropping the assertion, or
refactoring it so it observes the situation where the implicit grabs were
already undone. This commit implements the latter.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2700

Fixes: debbd88f8c ("clutter/stage: Cancel parts of implicit grabs when ClutterGrabs happen")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3216>
2023-09-03 10:15:46 +00:00
Jonas Dreßler
a243050bab clutter/stage: Fix an indentation mistake
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3216>
2023-09-03 10:15:46 +00:00
Jonas Dreßler
e5b50d14cf wayland: Get device directly from clutter in get_grab_info() for touch case
When we call get_grab_info() to get the sequence, device and coordinates for
a touch window drag, as the device we use the device from the
MetaWaylandPointer, assuming that it's set to the core pointer.

In the case where there is no pointer device present on the seat (so no
mouse nor touchpad), the wayland pointer remains disabled though, and
pointer->device is NULL.

This means touch window dragging on hardware without pointer devices
present is broken (because MetaWindowDrag assumes that there's a valid
device passed in meta_window_drag_begin()). Fix it by taking the core
pointer directly from ClutterSeat instead of going the extra detour through
MetaWaylandPointer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3238>
2023-09-03 09:12:29 +00:00
Georges Basile Stavracas Neto
94a39087bc eis-client: Always set has_position variable
If meta_eis_viewport_get_position() returned FALSE, the variable
'has_position' would be initialized. This variable represents
exactly the return value of meta_eis_viewport_get_position(),
so just assign it to the variable directly.

Spotted by Coverity.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3237>
2023-09-02 19:05:13 +00:00
A S Alam
8f0759f0dc Update Punjabi translation 2023-09-02 15:27:18 +00:00
Pascal Nowack
38cdaaf1f8 backends/eis-client: Use scroll source 'wheel' instead of 'unknown'
CLUTTER_SCROLL_SOURCE_UNKNOWN only generates continuous scroll events
and no discrete scroll events.
As a result, scrolling only works in applications, that support high
resolution scroll wheels, like GTK4 applications.
GTK3 applications, on the other hand, don't support high resolution
scroll wheel events, and such scrolling does not work in these
applications.

Fix this issue by using the scroll source CLUTTER_SCROLL_SOURCE_WHEEL.
Since commit 92a90774a4 ([0]),
CLUTTER_SCROLL_SOURCE_WHEEL generates discrete events to ensure that
scrolling in legacy applications still works.

[0]: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2664

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3235>
2023-09-02 11:58:35 +00:00
Jonas Ådahl
b20d7a5cc4 renderer/native: Don't queue mode set on hotplug power-save on
We need to trigger a mode set when power-save changes to 'on' if it's
purely about power saving, but when they arrive as part of a hotplug
event, we'll handle all that later, in the monitors-changed handling,
that contains the new configuration.

This avoids a crash that happens due to the mode set being queued on now
disabled connectors.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2985
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3233>
2023-09-02 11:07:39 +00:00
Jonas Ådahl
efbb8df611 tests/kms/hotplug: Clean up signal handlers in switch-config test
They remained connected, and poked at subsequent tests stack, causing
unexplainable crashes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3233>
2023-09-02 11:07:38 +00:00
Jonas Ådahl
96d4ae5ac8 monitor-manager: Add 'reason' argument to 'power-save-changed' signal
We can change power save mode for two reasons: gsd-power told us to, or
we saw a hotplug event. Sometimes it's useful to be able to make the
distinction to why a power save mode changed, so add a reason to the
signal.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3233>
2023-09-02 11:07:38 +00:00
Bilal Elmoussaoui
a7231ab2be docs: Update url maps
To get working items links

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3227>
2023-09-02 10:50:47 +00:00
Bilal Elmoussaoui
00a6fcb64d readme: Add Mtk docs link
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3227>
2023-09-02 10:50:47 +00:00
Daniel van Vugt
444e241ab4 kms/impl-device: Don't skip set_needs_flush during a page flip
If the deadline timer is disabled (like on nvidia-drm or when
`MUTTER_DEBUG_KMS_THREAD_TYPE=user`), then we need to call
`meta_kms_device_set_needs_flush` on every cursor movement. But some were
getting skipped if they coincided with page flips, which resulted in some
cursor movements failing to schedule the frame clock. This resulted in
unnecessary levels of frame skips when using lower frequency input devices
which are less likely to provide another event within the same frame period.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3002
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3210>
2023-09-02 10:30:58 +00:00