diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2019-11-26 08:58:22 +0100 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2019-11-26 11:14:30 +0100 |
commit | 11273ae5ae5ed5046e40cc2bbdc23c6b4c2040b1 (patch) | |
tree | 3eda64c3eb5b451f9783235a3f3d7fe240845d14 /main/gtk+3.0 | |
parent | e76b1149d8c7ae36e73d2979bbdd03a2f64b1836 (diff) | |
download | aports-11273ae5ae5ed5046e40cc2bbdc23c6b4c2040b1.tar.bz2 aports-11273ae5ae5ed5046e40cc2bbdc23c6b4c2040b1.tar.xz |
main/gtk+3.0: add patch fixing crashing of applications on Wayland when using a stylus
This fixes e.g. Xournalpp with a stylus
Diffstat (limited to 'main/gtk+3.0')
-rw-r--r-- | main/gtk+3.0/1121.patch | 107 | ||||
-rw-r--r-- | main/gtk+3.0/APKBUILD | 8 |
2 files changed, 112 insertions, 3 deletions
diff --git a/main/gtk+3.0/1121.patch b/main/gtk+3.0/1121.patch new file mode 100644 index 0000000000..c57ca54014 --- /dev/null +++ b/main/gtk+3.0/1121.patch @@ -0,0 +1,107 @@ +From d70f85d6b9e5bc8d0e9890eda55d05a2510f0037 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho <carlosg@gnome.org> +Date: Tue, 8 Oct 2019 17:46:38 +0200 +Subject: [PATCH 1/2] gdk: Fix wl_output accounting on tablet devices + +The code managing this accounting mixed seat and tablet output lists, +can't bode well. Fixes invalid reads on list elements, as there are +dangling pointers. + +Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157 +--- + gdk/wayland/gdkdevice-wayland.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c +index a64f33c871..fa292d25a7 100644 +--- a/gdk/wayland/gdkdevice-wayland.c ++++ b/gdk/wayland/gdkdevice-wayland.c +@@ -4616,7 +4616,7 @@ pointer_surface_enter (void *data, + if (tablet) + { + tablet->pointer_info.pointer_surface_outputs = +- g_slist_append (seat->pointer_info.pointer_surface_outputs, output); ++ g_slist_append (tablet->pointer_info.pointer_surface_outputs, output); + } + else + { +@@ -4645,7 +4645,7 @@ pointer_surface_leave (void *data, + if (tablet) + { + tablet->pointer_info.pointer_surface_outputs = +- g_slist_remove (seat->pointer_info.pointer_surface_outputs, output); ++ g_slist_remove (tablet->pointer_info.pointer_surface_outputs, output); + } + else + { +-- +2.22.0 + + +From bcd384711aab713d9928eb08fa0d1281b66bd659 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho <carlosg@gnome.org> +Date: Tue, 8 Oct 2019 17:50:48 +0200 +Subject: [PATCH 2/2] gdk: Avoid poking possibly freed memory + +The event may end up freed after delivery, ensure to keep the data we need +in order to emit the matching emulated crossed event matching a proximity +event. + +Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157 +--- + gdk/wayland/gdkdevice-wayland.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c +index fa292d25a7..4773f63ffa 100644 +--- a/gdk/wayland/gdkdevice-wayland.c ++++ b/gdk/wayland/gdkdevice-wayland.c +@@ -3468,6 +3468,8 @@ static void + gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet, + guint32 time) + { ++ GdkEventType event_type; ++ GdkWindow *window; + GdkEvent *event; + + event = tablet->pointer_info.frame.event; +@@ -3476,7 +3478,10 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet, + if (!event) + return; + +- switch (event->type) ++ event_type = event->type; ++ window = g_object_ref (gdk_event_get_window (event)); ++ ++ switch (event_type) + { + case GDK_MOTION_NOTIFY: + event->motion.time = time; +@@ -3504,18 +3509,20 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet, + return; + } + +- if (event->type == GDK_PROXIMITY_OUT) +- emulate_crossing (event->proximity.window, NULL, tablet->master, ++ if (event_type == GDK_PROXIMITY_OUT) ++ emulate_crossing (window, NULL, tablet->master, + tablet->current_device, GDK_LEAVE_NOTIFY, + GDK_CROSSING_NORMAL, time); + + _gdk_wayland_display_deliver_event (gdk_seat_get_display (tablet->seat), + event); + +- if (event->type == GDK_PROXIMITY_IN) +- emulate_crossing (event->proximity.window, NULL, tablet->master, ++ if (event_type == GDK_PROXIMITY_IN) ++ emulate_crossing (window, NULL, tablet->master, + tablet->current_device, GDK_ENTER_NOTIFY, + GDK_CROSSING_NORMAL, time); ++ ++ g_object_unref (window); + } + + static GdkEvent * +-- +2.22.0 + diff --git a/main/gtk+3.0/APKBUILD b/main/gtk+3.0/APKBUILD index 1cfb3184e4..67b0efaee1 100644 --- a/main/gtk+3.0/APKBUILD +++ b/main/gtk+3.0/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: Rasmus Thomsen <oss@cogitri.dev> pkgname=gtk+3.0 pkgver=3.24.12 -pkgrel=0 +pkgrel=1 pkgdesc="The GTK+ Toolkit (v3)" url="https://www.gtk.org/" install="$pkgname.post-install $pkgname.post-upgrade $pkgname.post-deinstall" @@ -53,7 +53,8 @@ makedepends=" libxfixes-dev libxrandr-dev" source="https://download.gnome.org/sources/gtk+/${pkgver%.*}/gtk+-$pkgver.tar.xz - 10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch" + 10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch + 1121.patch" builddir="$srcdir/gtk+-$pkgver" @@ -122,4 +123,5 @@ demo() { } sha512sums="97554657d83db71ff8b3ea5f650ad38b1ffcc3e8d620be876b5ca435f693e229dffc7341a84bde71bdae13293f2c1d3b2ab1b80a02791132c8a7693cdc21f612 gtk+-3.24.12.tar.xz -e4ea76484b70bd9beb65b2964bbcff3b3f78f5f6fe70b12309a7721ca134e3735e8aaac09803f93b393a6130a703f8f346c0df89ad45d18c580dac1e0e922276 10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch" +e4ea76484b70bd9beb65b2964bbcff3b3f78f5f6fe70b12309a7721ca134e3735e8aaac09803f93b393a6130a703f8f346c0df89ad45d18c580dac1e0e922276 10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch +e736fc9c0e60eabe377d474dcc091cdd49ec9368bbac7c95242783de50148b429c39a38fe5f6b5ec9135b109a2900e43a896867e95b996f4a2a53fbf45bbb532 1121.patch" |