Fix build with latest glibc, fix openQA clicking bug

This commit is contained in:
Adam Williamson 2022-01-27 09:30:46 -08:00
parent 31c3b2c8fa
commit 272a70e23a
3 changed files with 232 additions and 1 deletions

View File

@ -0,0 +1,177 @@
From dbfde95c5c7b4fb41e816b65d05d1ac20d59dd8a Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 26 Jan 2022 18:39:27 +0100
Subject: [PATCH 1/2] clutter: Do not check redraw area for pointer repicks
This looks like a relic of glReadPixels-based picking, the pointer
might well be outside redrawn areas, yet still require a device
update (e.g. in order to reflect the actor layout changes in the
"clear area" info).
Instead, always update all devices that are inside the view after
relayouts, the tracking on the need for that update is now done
on each ClutterStageView, instead of globally in the ClutterStage.
This theoretically fixes situations where pointers might miss
updating their "clear area" after the actor tree changed.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2117
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2257>
---
clutter/clutter/clutter-stage-private.h | 3 +-
clutter/clutter/clutter-stage-view-private.h | 2 +
clutter/clutter/clutter-stage-view.c | 14 ++++++-
clutter/clutter/clutter-stage.c | 39 ++++++++++++--------
4 files changed, 41 insertions(+), 17 deletions(-)
diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h
index 50502845bf..efa341cc19 100644
--- a/clutter/clutter/clutter-stage-private.h
+++ b/clutter/clutter/clutter-stage-private.h
@@ -75,7 +75,8 @@ void _clutter_stage_maybe_setup_viewport (ClutterStage
ClutterStageView *view);
void clutter_stage_maybe_relayout (ClutterActor *stage);
void clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage);
-GSList * clutter_stage_find_updated_devices (ClutterStage *stage);
+GSList * clutter_stage_find_updated_devices (ClutterStage *stage,
+ ClutterStageView *view);
void clutter_stage_update_devices (ClutterStage *stage,
GSList *devices);
void clutter_stage_finish_layout (ClutterStage *stage);
diff --git a/clutter/clutter/clutter-stage-view-private.h b/clutter/clutter/clutter-stage-view-private.h
index 0a20d75b17..39d8601ea5 100644
--- a/clutter/clutter/clutter-stage-view-private.h
+++ b/clutter/clutter/clutter-stage-view-private.h
@@ -79,4 +79,6 @@ void clutter_stage_view_notify_presented (ClutterStageView *view,
CLUTTER_EXPORT
void clutter_stage_view_notify_ready (ClutterStageView *view);
+void clutter_stage_view_invalidate_input_devices (ClutterStageView *view);
+
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index ea7f572480..8a82de71ed 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -93,6 +93,7 @@ typedef struct _ClutterStageViewPrivate
guint dirty_viewport : 1;
guint dirty_projection : 1;
+ guint needs_update_devices : 1;
} ClutterStageViewPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageView, clutter_stage_view, G_TYPE_OBJECT)
@@ -1176,7 +1177,8 @@ handle_frame_clock_frame (ClutterFrameClock *frame_clock,
clutter_stage_finish_layout (stage);
- devices = clutter_stage_find_updated_devices (stage);
+ if (priv->needs_update_devices)
+ devices = clutter_stage_find_updated_devices (stage, view);
frame = CLUTTER_FRAME_INIT;
@@ -1200,6 +1202,7 @@ handle_frame_clock_frame (ClutterFrameClock *frame_clock,
_clutter_stage_window_finish_frame (stage_window, view, &frame);
clutter_stage_update_devices (stage, devices);
+ priv->needs_update_devices = FALSE;
_clutter_run_repaint_functions (CLUTTER_REPAINT_FLAGS_POST_PAINT);
clutter_stage_emit_after_update (stage, view);
@@ -1522,3 +1525,12 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass)
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}
+
+void
+clutter_stage_view_invalidate_input_devices (ClutterStageView *view)
+{
+ ClutterStageViewPrivate *priv =
+ clutter_stage_view_get_instance_private (view);
+
+ priv->needs_update_devices = TRUE;
+}
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 3ef7ba69eb..c791959016 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -127,7 +127,6 @@ struct _ClutterStagePrivate
int update_freeze_count;
- gboolean needs_update_devices;
gboolean pending_finish_queue_redraws;
GHashTable *pointer_devices;
@@ -785,6 +784,19 @@ clutter_stage_dequeue_actor_relayout (ClutterStage *stage,
}
}
+static void
+clutter_stage_invalidate_views_devices (ClutterStage *stage)
+{
+ GList *l;
+
+ for (l = clutter_stage_peek_stage_views (stage); l; l = l->next)
+ {
+ ClutterStageView *view = l->data;
+
+ clutter_stage_view_invalidate_input_devices (view);
+ }
+}
+
void
clutter_stage_maybe_relayout (ClutterActor *actor)
{
@@ -832,36 +844,33 @@ clutter_stage_maybe_relayout (ClutterActor *actor)
CLUTTER_NOTE (ACTOR, "<<< Completed recomputing layout of %d subtrees", count);
if (count)
- priv->needs_update_devices = TRUE;
+ clutter_stage_invalidate_views_devices (stage);
}
GSList *
-clutter_stage_find_updated_devices (ClutterStage *stage)
+clutter_stage_find_updated_devices (ClutterStage *stage,
+ ClutterStageView *view)
{
ClutterStagePrivate *priv = stage->priv;
GSList *updating = NULL;
GHashTableIter iter;
gpointer value;
- if (!priv->needs_update_devices)
- return NULL;
-
- priv->needs_update_devices = FALSE;
-
g_hash_table_iter_init (&iter, priv->pointer_devices);
while (g_hash_table_iter_next (&iter, NULL, &value))
{
PointerDeviceEntry *entry = value;
- ClutterStageView *view;
- const cairo_region_t *clip;
+ ClutterStageView *pointer_view;
- view = clutter_stage_get_view_at (stage, entry->coords.x, entry->coords.y);
- if (!view)
+ pointer_view = clutter_stage_get_view_at (stage,
+ entry->coords.x,
+ entry->coords.y);
+ if (!pointer_view)
+ continue;
+ if (pointer_view != view)
continue;
- clip = clutter_stage_view_peek_redraw_clip (view);
- if (!clip || cairo_region_contains_point (clip, entry->coords.x, entry->coords.y))
- updating = g_slist_prepend (updating, entry->device);
+ updating = g_slist_prepend (updating, entry->device);
}
return updating;
--
2.35.0.rc1

View File

@ -0,0 +1,40 @@
From 103f2129530c1c4d4a1a99419005dcdd08d38748 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 26 Jan 2022 15:44:31 -0800
Subject: [PATCH 2/2] Drop "CI" test setup that needs catchsegv
glibc has dropped catchsegv:
https://sourceware.org/bugzilla/show_bug.cgi?id=14913
so mutter no longer builds with recent glibc.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
meson.build | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/meson.build b/meson.build
index 4f7f023043..2a963b3b37 100644
--- a/meson.build
+++ b/meson.build
@@ -327,18 +327,6 @@ if have_tests
)
add_test_setup('plain')
-
- add_test_setup('CI',
- env: [
- 'MUTTER_DEBUG_DUMMY_MODE_SPECS=800x600@10.0',
- ],
- exe_wrapper: [
- default_test_wrappers,
- find_program('catchsegv'),
- find_program('xvfb-run'), '-a', '-s', '+iglx -noreset',
- ],
- timeout_multiplier: 10,
- )
endif
have_profiler = get_option('profiler')
--
2.35.0.rc1

View File

@ -10,7 +10,7 @@
Name: mutter
Version: 42~alpha
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -26,6 +26,16 @@ 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
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2257
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2117
# Fixes a bug that caused clicking not to work in openQA tests sometimes
Patch3: 0001-clutter-Do-not-check-redraw-area-for-pointer-repicks.patch
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2120
# Fixes build with recent glibc. Upstream may not do exactly this but
# it's good enough for a package build
Patch4: 0002-Drop-CI-test-setup-that-needs-catchsegv.patch
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(libwacom)
@ -169,6 +179,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Thu Jan 27 2022 Adam Williamson <awilliam@redhat.com> - 42~alpha-3
- Drop a test setup to fix build with latest glibc (catchsegv removed)
- Backport MR #2257 to fix clicks on burger menus failing in openQA
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 42~alpha-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild