Update to 42.1

This commit is contained in:
Florian Müllner 2022-05-06 20:42:13 +02:00
parent 42dd39a354
commit d8a3826d4a
11 changed files with 5 additions and 2263 deletions

View File

@ -1,169 +0,0 @@
From 2aad56b949b86b4f1d0eab6d3d3b0d5491e8515b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Sat, 5 Mar 2022 23:43:29 +0100
Subject: [PATCH 1/2] clutter: Pass target actor of events to event filter
functions
We'll need the additional context of which actor the event will be
emitted to in mutters event filter (see next commit), so pass that
target actor to the event filters that are installed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2321>
---
clutter/clutter/clutter-event-private.h | 3 ++-
clutter/clutter/clutter-event.c | 5 +++--
clutter/clutter/clutter-event.h | 2 ++
clutter/clutter/clutter-main.c | 12 +++++++++++-
clutter/clutter/clutter-stage.c | 6 +++---
src/core/events.c | 6 ++++--
6 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/clutter/clutter/clutter-event-private.h b/clutter/clutter/clutter-event-private.h
index 011241ce18..69fdf24ed6 100644
--- a/clutter/clutter/clutter-event-private.h
+++ b/clutter/clutter/clutter-event-private.h
@@ -14,7 +14,8 @@ CLUTTER_EXPORT
void _clutter_process_event (ClutterEvent *event);
CLUTTER_EXPORT
-gboolean _clutter_event_process_filters (ClutterEvent *event);
+gboolean _clutter_event_process_filters (ClutterEvent *event,
+ ClutterActor *event_actor);
/* clears the event queue inside the main context */
void _clutter_clear_events_queue (void);
diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c
index b1a5b6252f..0433a1ec98 100644
--- a/clutter/clutter/clutter-event.c
+++ b/clutter/clutter/clutter-event.c
@@ -1772,7 +1772,8 @@ clutter_event_is_pointer_emulated (const ClutterEvent *event)
}
gboolean
-_clutter_event_process_filters (ClutterEvent *event)
+_clutter_event_process_filters (ClutterEvent *event,
+ ClutterActor *event_actor)
{
ClutterMainContext *context = _clutter_context_get_default ();
GList *l, *next;
@@ -1789,7 +1790,7 @@ _clutter_event_process_filters (ClutterEvent *event)
if (event_filter->stage && event_filter->stage != event->any.stage)
continue;
- if (event_filter->func (event, event_filter->user_data) == CLUTTER_EVENT_STOP)
+ if (event_filter->func (event, event_actor, event_filter->user_data) == CLUTTER_EVENT_STOP)
return CLUTTER_EVENT_STOP;
}
diff --git a/clutter/clutter/clutter-event.h b/clutter/clutter/clutter-event.h
index 5a8e3c116a..94595542cd 100644
--- a/clutter/clutter/clutter-event.h
+++ b/clutter/clutter/clutter-event.h
@@ -615,6 +615,7 @@ union _ClutterEvent
/**
* ClutterEventFilterFunc:
* @event: the event that is going to be emitted
+ * @event_actor: the current device actor of the events device
* @user_data: the data pointer passed to clutter_event_add_filter()
*
* A function pointer type used by event filters that are added with
@@ -628,6 +629,7 @@ union _ClutterEvent
* Since: 1.18
*/
typedef gboolean (* ClutterEventFilterFunc) (const ClutterEvent *event,
+ ClutterActor *event_actor,
gpointer user_data);
CLUTTER_EXPORT
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index 402ca65547..e066e5aebe 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -741,6 +741,8 @@ update_device_for_event (ClutterStage *stage,
void
clutter_do_event (ClutterEvent *event)
{
+ ClutterActor *event_actor = NULL;
+
/* we need the stage for the event */
if (event->any.stage == NULL)
{
@@ -765,7 +767,15 @@ clutter_do_event (ClutterEvent *event)
break;
}
- if (_clutter_event_process_filters (event))
+ if (event->any.type != CLUTTER_DEVICE_ADDED &&
+ event->any.type != CLUTTER_DEVICE_REMOVED &&
+ event->any.type != CLUTTER_NOTHING &&
+ event->any.type != CLUTTER_EVENT_LAST)
+ {
+ event_actor = clutter_stage_get_event_actor (event->any.stage, event);
+ }
+
+ if (_clutter_event_process_filters (event, event_actor))
return;
/* Instead of processing events when received, we queue them up to
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index f34a424797..5cd09a2c44 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -3478,7 +3478,7 @@ clutter_stage_update_device (ClutterStage *stage,
CLUTTER_EVENT_NONE,
old_actor, new_actor,
point, time_ms);
- if (!_clutter_event_process_filters (event))
+ if (!_clutter_event_process_filters (event, old_actor))
_clutter_actor_handle_event (old_actor, root, event);
clutter_event_free (event);
@@ -3492,7 +3492,7 @@ clutter_stage_update_device (ClutterStage *stage,
CLUTTER_EVENT_NONE,
new_actor, old_actor,
point, time_ms);
- if (!_clutter_event_process_filters (event))
+ if (!_clutter_event_process_filters (event, new_actor))
_clutter_actor_handle_event (new_actor, root, event);
clutter_event_free (event);
@@ -3676,7 +3676,7 @@ clutter_stage_notify_grab_on_pointer_entry (ClutterStage *stage,
grab_actor : old_grab_actor,
entry->coords,
CLUTTER_CURRENT_TIME);
- if (!_clutter_event_process_filters (event))
+ if (!_clutter_event_process_filters (event, entry->current_actor))
_clutter_actor_handle_event (deepmost, topmost, event);
clutter_event_free (event);
}
diff --git a/src/core/events.c b/src/core/events.c
index 8363d9a3d3..7dfd974563 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -213,7 +213,8 @@ maybe_unfreeze_pointer_events (MetaBackend *backend,
static gboolean
meta_display_handle_event (MetaDisplay *display,
- const ClutterEvent *event)
+ const ClutterEvent *event,
+ ClutterActor *event_actor)
{
MetaBackend *backend = meta_get_backend ();
MetaWindow *window = NULL;
@@ -540,11 +541,12 @@ meta_display_handle_event (MetaDisplay *display,
static gboolean
event_callback (const ClutterEvent *event,
+ ClutterActor *event_actor,
gpointer data)
{
MetaDisplay *display = data;
- return meta_display_handle_event (display, event);
+ return meta_display_handle_event (display, event, event_actor);
}
void
--
2.35.1

View File

@ -1,65 +0,0 @@
From ce7f606d48f1a422465fd597c33047727993988a Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 30 Mar 2022 20:59:37 +0200
Subject: [PATCH 1/2] clutter: Refactor code marking actors dirty for paint()
Simplify the function arguments (the origin is just the actor that
the function is originally called from), and make it also handle
marking as dirty the actor that got the redraw queued up explicitly.
This makes it a single place where priv->is_dirty is being enabled.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2353>
---
clutter/clutter/clutter-actor.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 59345a7252..2e4b30effc 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -2646,9 +2646,10 @@ _clutter_actor_queue_redraw_on_clones (ClutterActor *self)
}
static void
-_clutter_actor_propagate_queue_redraw (ClutterActor *self,
- ClutterActor *origin)
+_clutter_actor_propagate_queue_redraw (ClutterActor *self)
{
+ ClutterActor *origin = self;
+
while (self)
{
/* no point in queuing a redraw on a destroyed actor */
@@ -2657,13 +2658,12 @@ _clutter_actor_propagate_queue_redraw (ClutterActor *self,
_clutter_actor_queue_redraw_on_clones (self);
+ self->priv->is_dirty = TRUE;
+
/* If the queue redraw is coming from a child then the actor has
become dirty and any queued effect is no longer valid */
if (self != origin)
- {
- self->priv->is_dirty = TRUE;
- self->priv->effect_to_redraw = NULL;
- }
+ self->priv->effect_to_redraw = NULL;
/* If the actor isn't visible, we still had to emit the signal
* to allow for a ClutterClone, but the appearance of the parent
@@ -8105,10 +8105,8 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
priv->effect_to_redraw = NULL;
}
- priv->is_dirty = TRUE;
-
if (!priv->propagated_one_redraw)
- _clutter_actor_propagate_queue_redraw (self, self);
+ _clutter_actor_propagate_queue_redraw (self);
}
/**
--
2.35.1

View File

@ -1,51 +0,0 @@
From 11e6100226006b5371de30310357582db64c9309 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Tue, 5 Apr 2022 17:05:17 +0800
Subject: [PATCH 1/2] kms/impl-device: Add addfb2_modifiers to
MetaKmsDeviceCaps
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2359>
---
src/backends/native/meta-kms-impl-device.c | 6 ++++++
src/backends/native/meta-kms-impl-device.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c
index b05bf5fdab..ec1a0e5a45 100644
--- a/src/backends/native/meta-kms-impl-device.c
+++ b/src/backends/native/meta-kms-impl-device.c
@@ -303,6 +303,7 @@ init_caps (MetaKmsImplDevice *impl_device)
uint64_t cursor_width, cursor_height;
uint64_t prefer_shadow;
uint64_t uses_monotonic_clock;
+ uint64_t addfb2_modifiers;
fd = meta_device_file_get_fd (priv->device_file);
if (drmGetCap (fd, DRM_CAP_CURSOR_WIDTH, &cursor_width) == 0 &&
@@ -325,6 +326,11 @@ init_caps (MetaKmsImplDevice *impl_device)
{
priv->caps.uses_monotonic_clock = uses_monotonic_clock;
}
+
+ if (drmGetCap (fd, DRM_CAP_ADDFB2_MODIFIERS, &addfb2_modifiers) == 0)
+ {
+ priv->caps.addfb2_modifiers = (addfb2_modifiers != 0);
+ }
}
static void
diff --git a/src/backends/native/meta-kms-impl-device.h b/src/backends/native/meta-kms-impl-device.h
index e81f00e39c..286c2700a6 100644
--- a/src/backends/native/meta-kms-impl-device.h
+++ b/src/backends/native/meta-kms-impl-device.h
@@ -40,6 +40,7 @@ typedef struct _MetaKmsDeviceCaps
gboolean prefers_shadow_buffer;
gboolean uses_monotonic_clock;
+ gboolean addfb2_modifiers;
} MetaKmsDeviceCaps;
typedef struct _MetaKmsProp MetaKmsProp;
--
2.36.0

View File

@ -1,59 +0,0 @@
From f820bb35067f1e6b54d56f7652ee333ac8c8c35b Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 30 Mar 2022 21:02:18 +0200
Subject: [PATCH 2/2] clutter: Keep actors dirty if a redraw was queued up
during paint()
In the right combination of circumstances, and given 2 actors (parent
actor P with an offscreen effect and child actor C), we may have the
following situation happening:
- A redraw is queued on the actor C, actors C and P are marked as
priv->is_dirty and priv->propagated_one_redraw.
- During paint() handling we paint actor P, priv->propagated_one_redraw
is turned off.
- We recurse into child actor C, priv->propagated_one_redraw is turned
off.
- A new redraw is queued on actor C, actors C and P are marked as
priv->is_dirty and priv->propagated_one_redraw.
- The paint() method recurses back, actors C and P get priv->is_dirty
disabled, priv->propagated_one_redraw remains set.
- At this point queueing up more redraws on actor C will not propagate
up, because actor C has priv->propagated_one_redraw set, but the
parent actor P has priv->is_dirty unset, so the offscreen effect will
not get CLUTTER_EFFECT_PAINT_ACTOR_DIRTY and will avoid repainting
actor C.
The end result is that actor C does not redraw again, despite requesting
redraws. This situation eventually resolves itself through e.g. relayouts
on actor P, but may take some time to happen.
In order to fix this, consider actors that did get a further redraw
request still dirty after paint().
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2188
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2353>
---
clutter/clutter/clutter-actor.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 2e4b30effc..23ef03dc1f 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -3840,8 +3840,10 @@ clutter_actor_paint (ClutterActor *self,
clutter_paint_node_paint (root_node, paint_context);
/* If we make it here then the actor has run through a complete
- paint run including all the effects so it's no longer dirty */
- priv->is_dirty = FALSE;
+ * paint run including all the effects so it's no longer dirty,
+ * unless a new redraw was queued up.
+ */
+ priv->is_dirty = priv->propagated_one_redraw;
}
/**
--
2.35.1

View File

@ -1,70 +0,0 @@
From 0280b0aaa563db65bf79a3643f6a9e8e76bfe458 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Sat, 5 Mar 2022 23:46:24 +0100
Subject: [PATCH 2/2] events: Use the event target actor to determine window
for event
We use get_window_for_event() to check whether an event happened on top
of a window or on top of shell UI to decide whether to bypass delivering
the event to Clutter. In case of crossing events though, we can't just
use the device actor to determine whether to forward the event to
Clutter or not: We do want to forward CLUTTER_LEAVE events which
happened on top of shell UI. In that case the device actor is already a
window actor (the pointer already is on top of a window), but the shell
still needs to get the LEAVE crossing event.
Since the event source actor got removed from the detail of
ClutterEvent, the context we're looking for (which actor did the pointer
leave) is now the target actor that the event gets emitted to. Since the
last commit, we also made event filters aware of this context by passing
the target actor to them, so use this context now to determine whether
we're on top of a window or not.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2321>
---
src/core/events.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/core/events.c b/src/core/events.c
index 7dfd974563..0dc3a73222 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -81,23 +81,20 @@ stage_has_grab (MetaDisplay *display)
static MetaWindow *
get_window_for_event (MetaDisplay *display,
- const ClutterEvent *event)
+ const ClutterEvent *event,
+ ClutterActor *event_actor)
{
switch (display->event_route)
{
case META_EVENT_ROUTE_NORMAL:
{
- ClutterActor *target;
MetaWindowActor *window_actor;
/* Always use the key focused window for key events. */
if (IS_KEY_EVENT (event))
return stage_has_key_focus () ? display->focus_window : NULL;
- target = clutter_stage_get_device_actor (clutter_event_get_stage (event),
- clutter_event_get_device (event),
- clutter_event_get_event_sequence (event));
- window_actor = meta_window_actor_from_actor (target);
+ window_actor = meta_window_actor_from_actor (event_actor);
if (window_actor)
return meta_window_actor_get_meta_window (window_actor);
else
@@ -339,7 +336,7 @@ meta_display_handle_event (MetaDisplay *display,
}
#endif
- window = get_window_for_event (display, event);
+ window = get_window_for_event (display, event, event_actor);
display->current_time = event->any.time;
--
2.35.1

View File

@ -1,29 +0,0 @@
From dd94c448e94b1033b90749d77c5dc587c3b8f9f4 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Tue, 5 Apr 2022 17:06:21 +0800
Subject: [PATCH 2/2] kms/device: Disable modifiers when
!DRM_CAP_ADDFB2_MODIFIERS
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2210
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2359>
---
src/backends/native/meta-kms-device.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/backends/native/meta-kms-device.c b/src/backends/native/meta-kms-device.c
index bef1e20657..7c84f14f51 100644
--- a/src/backends/native/meta-kms-device.c
+++ b/src/backends/native/meta-kms-device.c
@@ -490,6 +490,9 @@ meta_kms_device_new (MetaKms *kms,
free (device->path);
device->path = data.out_path;
+ if (!device->caps.addfb2_modifiers)
+ device->flags |= META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS;
+
return device;
}
--
2.36.0

View File

@ -1,76 +0,0 @@
From 53de072634527c5f433911553d8f921a6e119ac1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Wed, 16 Feb 2022 22:34:12 +0100
Subject: [PATCH] clutter: Bail out and warn on reentry into mapping/unmapping
cycle
There's a bunch of crashes right now where the assertions in
clutter_actor_set_mapped() after calling the map/unmap() vfuncs are
failing. The only way this can happen is by re-entering
clutter_actor_set_mapped() during the map/unmap recursion.
The reason for those crashes is that the shell hides/shows some actors
in response to crossing events and key-focus changes. These in turn get
triggered by the newly introduced ungrabbing of ClutterGrabs when an
actor gets unmapped, which triggers GRAB_NOTIFY crossing events and
key-focus changes.
Since these situations are hardly avoidable (it's a valid use-case to
hide/show something in response to a crossing/key-focus event), catch
the set_mapped() call early while we reenter the mapping machinery and
log a warning instead of crashing.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3165
---
clutter/clutter/clutter-actor.c | 6 ++++++
clutter/clutter/clutter-private.h | 3 +++
2 files changed, 9 insertions(+)
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 59345a7252..bae11088dd 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1264,6 +1264,10 @@ clutter_actor_set_mapped (ClutterActor *self,
if (CLUTTER_ACTOR_IS_MAPPED (self) == mapped)
return;
+ g_return_if_fail (!CLUTTER_ACTOR_IN_MAP_UNMAP (self));
+
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_MAP_UNMAP);
+
if (mapped)
{
CLUTTER_ACTOR_GET_CLASS (self)->map (self);
@@ -1274,6 +1278,8 @@ clutter_actor_set_mapped (ClutterActor *self,
CLUTTER_ACTOR_GET_CLASS (self)->unmap (self);
g_assert (!CLUTTER_ACTOR_IS_MAPPED (self));
}
+
+ CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_MAP_UNMAP);
}
/* this function updates the mapped and realized states according to
diff --git a/clutter/clutter/clutter-private.h b/clutter/clutter/clutter-private.h
index 377b318798..117902a35f 100644
--- a/clutter/clutter/clutter-private.h
+++ b/clutter/clutter/clutter-private.h
@@ -69,6 +69,7 @@ typedef struct _ClutterMainContext ClutterMainContext;
#define CLUTTER_ACTOR_IN_PREF_WIDTH(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_WIDTH) != FALSE)
#define CLUTTER_ACTOR_IN_PREF_HEIGHT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_HEIGHT) != FALSE)
#define CLUTTER_ACTOR_IN_PREF_SIZE(a) ((CLUTTER_PRIVATE_FLAGS (a) & (CLUTTER_IN_PREF_HEIGHT|CLUTTER_IN_PREF_WIDTH)) != FALSE)
+#define CLUTTER_ACTOR_IN_MAP_UNMAP(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_MAP_UNMAP) != FALSE)
#define CLUTTER_PARAM_READABLE (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
#define CLUTTER_PARAM_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
@@ -105,6 +106,8 @@ typedef enum
/* Used to avoid recursion */
CLUTTER_IN_RELAYOUT = 1 << 7,
+
+ CLUTTER_IN_MAP_UNMAP = 1 << 8,
} ClutterPrivateFlags;
/*
--
GitLab

1438
2331.patch

File diff suppressed because it is too large Load Diff

View File

@ -1,223 +0,0 @@
From 8b0607cc4dd919bdf2e6c2bc1104032fc115c338 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Wed, 9 Mar 2022 15:53:11 +0100
Subject: [PATCH] clutter/stage: Repick when pointer actor goes unmapped
I've overseen quite an important case in commit
98a5cb37d9159737f8f1af4196420db90bfcf879: Repicking only when actors get
destroyed is not enough, we actually need to repick when actors go
hidden/unmapped.
While we could also listen to notify::mapped just like we listen to
notify::reactive, it seems better to avoid using property notifications
here due to the usage of g_object_freeze/thaw_notify() in ClutterActor.
It can lead to the stage receiving a notify::mapped with mapped = true
for a pointer actor, which really shouldn't happen (just like
notify::reactive with reactive = true shouldn't happen).
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5124
---
clutter/clutter/clutter-actor.c | 18 ++++
clutter/clutter/clutter-stage-private.h | 3 +
clutter/clutter/clutter-stage.c | 105 +++++++++++-------------
3 files changed, 69 insertions(+), 57 deletions(-)
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 23ef03dc1f..4c1624e738 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1695,6 +1695,13 @@ clutter_actor_real_unmap (ClutterActor *self)
*/
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_MAPPED]);
+ if (priv->has_pointer)
+ {
+ ClutterActor *stage = _clutter_actor_get_stage_internal (self);
+
+ clutter_stage_invalidate_focus (CLUTTER_STAGE (stage), self);
+ }
+
/* relinquish keyboard focus if we were unmapped while owning it */
if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
maybe_unset_key_focus (self);
@@ -12434,8 +12441,12 @@ void
clutter_actor_set_reactive (ClutterActor *actor,
gboolean reactive)
{
+ ClutterActorPrivate *priv;
+
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
+ priv = actor->priv;
+
if (reactive == CLUTTER_ACTOR_IS_REACTIVE (actor))
return;
@@ -12445,6 +12456,13 @@ clutter_actor_set_reactive (ClutterActor *actor,
CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
g_object_notify_by_pspec (G_OBJECT (actor), obj_props[PROP_REACTIVE]);
+
+ if (!CLUTTER_ACTOR_IS_REACTIVE (actor) && priv->has_pointer)
+ {
+ ClutterActor *stage = _clutter_actor_get_stage_internal (actor);
+
+ clutter_stage_invalidate_focus (CLUTTER_STAGE (stage), actor);
+ }
}
/**
diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h
index efa341cc19..e9ba5707ed 100644
--- a/clutter/clutter/clutter-stage-private.h
+++ b/clutter/clutter/clutter-stage-private.h
@@ -154,6 +154,9 @@ ClutterActor * clutter_stage_pick_and_update_device (ClutterStage *s
void clutter_stage_unlink_grab (ClutterStage *self,
ClutterGrab *grab);
+void clutter_stage_invalidate_focus (ClutterStage *self,
+ ClutterActor *actor);
+
G_END_DECLS
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 5cd09a2c44..705bd92a8f 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -3150,53 +3150,62 @@ clutter_stage_set_actor_needs_immediate_relayout (ClutterStage *stage)
priv->actor_needs_immediate_relayout = TRUE;
}
-static void
-on_device_actor_reactive_changed (ClutterActor *actor,
- GParamSpec *pspec,
- PointerDeviceEntry *entry)
+void
+clutter_stage_invalidate_focus (ClutterStage *self,
+ ClutterActor *actor)
{
- ClutterStage *self = entry->stage;
+ ClutterStagePrivate *priv = self->priv;
+ GHashTableIter iter;
+ gpointer value;
- g_assert (!clutter_actor_get_reactive (actor));
+ if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
+ return;
- clutter_stage_pick_and_update_device (self,
- entry->device,
- entry->sequence,
- CLUTTER_DEVICE_UPDATE_IGNORE_CACHE |
- CLUTTER_DEVICE_UPDATE_EMIT_CROSSING,
- entry->coords,
- CLUTTER_CURRENT_TIME);
-}
+ g_assert (!clutter_actor_is_mapped (actor) || !clutter_actor_get_reactive (actor));
-static void
-on_device_actor_destroyed (ClutterActor *actor,
- PointerDeviceEntry *entry)
-{
- /* Simply unset the current_actor pointer here, there's no need to
- * unset has_pointer or to disconnect any signals because the actor
- * is gone anyway.
- */
- entry->current_actor = NULL;
- g_clear_pointer (&entry->clear_area, cairo_region_destroy);
- clutter_stage_repick_device (entry->stage, entry->device);
+ g_hash_table_iter_init (&iter, priv->pointer_devices);
+ while (g_hash_table_iter_next (&iter, NULL, &value))
+ {
+ PointerDeviceEntry *entry = value;
+
+ if (entry->current_actor != actor)
+ continue;
+
+ clutter_stage_pick_and_update_device (self,
+ entry->device,
+ NULL,
+ CLUTTER_DEVICE_UPDATE_IGNORE_CACHE |
+ CLUTTER_DEVICE_UPDATE_EMIT_CROSSING,
+ entry->coords,
+ CLUTTER_CURRENT_TIME);
+ }
+
+ g_hash_table_iter_init (&iter, priv->touch_sequences);
+ while (g_hash_table_iter_next (&iter, NULL, &value))
+ {
+ PointerDeviceEntry *entry = value;
+
+ if (entry->current_actor != actor)
+ continue;
+
+ clutter_stage_pick_and_update_device (self,
+ entry->device,
+ entry->sequence,
+ CLUTTER_DEVICE_UPDATE_IGNORE_CACHE |
+ CLUTTER_DEVICE_UPDATE_EMIT_CROSSING,
+ entry->coords,
+ CLUTTER_CURRENT_TIME);
+ }
+
+ if (actor != CLUTTER_ACTOR (self))
+ g_assert (!clutter_actor_has_pointer (actor));
}
static void
free_pointer_device_entry (PointerDeviceEntry *entry)
{
if (entry->current_actor)
- {
- ClutterActor *actor = entry->current_actor;
-
- g_signal_handlers_disconnect_by_func (actor,
- G_CALLBACK (on_device_actor_reactive_changed),
- entry);
- g_signal_handlers_disconnect_by_func (actor,
- G_CALLBACK (on_device_actor_destroyed),
- entry);
-
- _clutter_actor_set_has_pointer (actor, FALSE);
- }
+ _clutter_actor_set_has_pointer (entry->current_actor, FALSE);
g_clear_pointer (&entry->clear_area, cairo_region_destroy);
@@ -3240,30 +3249,12 @@ clutter_stage_update_device_entry (ClutterStage *self,
if (entry->current_actor != actor)
{
if (entry->current_actor)
- {
- ClutterActor *old_actor = entry->current_actor;
-
- g_signal_handlers_disconnect_by_func (old_actor,
- G_CALLBACK (on_device_actor_reactive_changed),
- entry);
- g_signal_handlers_disconnect_by_func (old_actor,
- G_CALLBACK (on_device_actor_destroyed),
- entry);
-
- _clutter_actor_set_has_pointer (old_actor, FALSE);
- }
+ _clutter_actor_set_has_pointer (entry->current_actor, FALSE);
entry->current_actor = actor;
if (actor)
- {
- g_signal_connect (actor, "notify::reactive",
- G_CALLBACK (on_device_actor_reactive_changed), entry);
- g_signal_connect (actor, "destroy",
- G_CALLBACK (on_device_actor_destroyed), entry);
-
- _clutter_actor_set_has_pointer (actor, TRUE);
- }
+ _clutter_actor_set_has_pointer (actor, TRUE);
}
g_clear_pointer (&entry->clear_area, cairo_region_destroy);
--
GitLab

View File

@ -1,37 +0,0 @@
From dd2eba8d12c2fca877e2180bbdcc5bce416781ae Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 6 Apr 2022 16:07:07 +0200
Subject: [PATCH] core: Account ClutterStage grabs on Wayland key focus
synchronization
When switching between the existence and not of a stage ClutterGrab, we
would correctly attempt to synchronize key focus from the perspective of
the Wayland clients.
But this synchronization should do its own checks about existing stage
grabs before determining a client window has key focus or not.
Add that check, so that grabs correctly unfocus the keyboard in Wayland
clients, in addition to pointers and touch.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2194
---
src/core/display.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/core/display.c b/src/core/display.c
index 5f99578a69..a1c5c2d912 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1431,6 +1431,8 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
focus_window = NULL;
else if (is_no_focus_xwindow)
focus_window = NULL;
+ else if (clutter_stage_get_grab_actor (CLUTTER_STAGE (stage)))
+ focus_window = NULL;
else if (display->focus_window && display->focus_window->surface)
focus_window = display->focus_window;
else
--
GitLab

View File

@ -9,8 +9,8 @@
%global tarball_version %%(echo %{version} | tr '~' '.')
Name: mutter
Version: 42.0
Release: 6%{?dist}
Version: 42.1
Release: 1%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -26,50 +26,6 @@ Patch1: 0001-Revert-build-Do-not-provide-built-sources-as-libmutt.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1936991
Patch2: mutter-42.alpha-disable-tegra.patch
# Handle input devices with multiple capabilities properly
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2331
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2154
# https://bugzilla.redhat.com/show_bug.cgi?id=2017043
Patch3: 2331.patch
# Avoid crashing on reentry into mapping/unmapping cycle
# https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3165
# https://bugzilla.redhat.com/show_bug.cgi?id=2063381
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2299
Patch4: 2299.patch
# Fix input to overview search freezing when using input method
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2188
# https://bugzilla.redhat.com/show_bug.cgi?id=2062660
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2353
Patch5: 0001-clutter-Refactor-code-marking-actors-dirty-for-paint.patch
Patch6: 0002-clutter-Keep-actors-dirty-if-a-redraw-was-queued-up-.patch
# Fix window switching being locked when dimming is interrupted
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2224
# https://bugzilla.redhat.com/show_bug.cgi?id=2073206
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2333
Patch7: 2333.patch
# Fix top bar hover issues
# https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5289
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2321
Patch8: 0001-clutter-Pass-target-actor-of-events-to-event-filter-.patch
Patch9: 0002-events-Use-the-event-target-actor-to-determine-windo.patch
# Fix issues with stuck modifier keys
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2194
# https://bugzilla.redhat.com/show_bug.cgi?id=2076390
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2366
Patch10: 2366.patch
# Fix graphics initialization on legacy Radeon
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2210
# https://bugzilla.redhat.com/show_bug.cgi?id=2081070
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2359
Patch11: 0001-kms-impl-device-Add-addfb2_modifiers-to-MetaKmsDevic.patch
Patch12: 0002-kms-device-Disable-modifiers-when-DRM_CAP_ADDFB2_MOD.patch
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(libwacom)
@ -213,6 +169,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Fri May 06 2022 Florian Müllner <fmuellner@redhat.com> - 42.1-1
- Update to 42.1
* Mon May 02 2022 Adam Williamson <awilliam@redhat.com> - 42.0-6
- Backport MR #2359 to fix GNOME on legacy Radeon (#2081070)