Backport MRs #2871 and #2872 to help fix broken alt-tab behavior

This commit is contained in:
Adam Williamson 2023-08-09 22:49:43 -07:00
parent 1a1c19edb7
commit 4ea9fdc45c
3 changed files with 1426 additions and 0 deletions

79
2871.patch Normal file
View File

@ -0,0 +1,79 @@
From 854191c2444cdc90e92bcb6684893148dd007798 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 8 Aug 2023 16:08:36 +0200
Subject: [PATCH 1/2] st: Handle emulated scroll events through the
ClutterEventFlag
Emulated scroll events no longer get clutter_event_is_pointer_emulated()
set to TRUE, instead this information is propagated through the
ClutterEventFlags of the event.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2871>
---
src/st/st-scroll-bar.c | 3 ++-
src/st/st-scroll-view.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c
index d5d5264943..e2c09203e1 100644
--- a/src/st/st-scroll-bar.c
+++ b/src/st/st-scroll-bar.c
@@ -469,7 +469,8 @@ st_scroll_bar_scroll_event (ClutterActor *actor,
ClutterTextDirection direction;
ClutterScrollDirection scroll_dir;
- if (clutter_event_is_pointer_emulated ((ClutterEvent *) event))
+ if (!!(clutter_event_get_flags ((ClutterEvent *) event) &
+ CLUTTER_EVENT_FLAG_POINTER_EMULATED))
return TRUE;
direction = clutter_actor_get_text_direction (actor);
diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c
index 9f667e5459..764065b606 100644
--- a/src/st/st-scroll-view.c
+++ b/src/st/st-scroll-view.c
@@ -770,7 +770,8 @@ st_scroll_view_scroll_event (ClutterActor *self,
if (!priv->mouse_scroll)
return FALSE;
- if (clutter_event_is_pointer_emulated ((ClutterEvent *) event))
+ if (!!(clutter_event_get_flags ((ClutterEvent *) event) &
+ CLUTTER_EVENT_FLAG_POINTER_EMULATED))
return TRUE;
direction = clutter_actor_get_text_direction (self);
--
GitLab
From c9741ae3d5f661b2aee352c50ce21fab16694fbe Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 8 Aug 2023 16:10:39 +0200
Subject: [PATCH 2/2] ui/slider: Handle emulated scroll events through the
Clutter.EventFlags
Emulated scroll events no longer get event.is_pointer_emulated() set to
True, instead this information is propagated through the Clutter.EventFlags
of the event.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2871>
---
js/ui/slider.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/ui/slider.js b/js/ui/slider.js
index 6653898b0c..4f60556aea 100644
--- a/js/ui/slider.js
+++ b/js/ui/slider.js
@@ -140,7 +140,7 @@ export const Slider = GObject.registerClass({
let direction = event.get_scroll_direction();
let delta;
- if (event.is_pointer_emulated())
+ if (event.get_flags() & Clutter.EventFlags.POINTER_EMULATED)
return Clutter.EVENT_PROPAGATE;
if (direction == Clutter.ScrollDirection.DOWN) {
--
GitLab

1339
2872.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,14 @@ License: GPLv2+
URL: https://wiki.gnome.org/Projects/GnomeShell
Source0: https://download.gnome.org/sources/gnome-shell/45/%{name}-%{tarball_version}.tar.xz
# Needed to fix broken alt-tab (along with gnome-shell patches)
# 2872 is the fix, but only applies clean on top of 2871
# https://gitlab.gnome.org/GNOME/mutter/-/issues/2950
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2871
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872
Patch0: 2871.patch
Patch1: 2872.patch
# Replace Epiphany with Firefox in the default favourite apps list
Patch10001: gnome-shell-favourite-apps-firefox.patch