From b36d4bd2980a72561e43fb2b0951def1488ea8d4 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 5 Aug 2022 23:31:08 -0400 Subject: [PATCH] xarchiver: fix double-clicking regression fixes #38487 --- srcpkgs/xarchiver/patches/doubleclick.patch | 75 +++++++++++++++++++++ srcpkgs/xarchiver/template | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xarchiver/patches/doubleclick.patch diff --git a/srcpkgs/xarchiver/patches/doubleclick.patch b/srcpkgs/xarchiver/patches/doubleclick.patch new file mode 100644 index 000000000000..aaac2c6b16e0 --- /dev/null +++ b/srcpkgs/xarchiver/patches/doubleclick.patch @@ -0,0 +1,75 @@ +From f245d8714690af30064a2e5ec94bd2374288c2b9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ingo=20Br=C3=BCckl?= +Date: Sat, 2 Jul 2022 23:47:36 +0200 +Subject: [PATCH 1/2] Simplify code + +The state of the modifier keys is available in event->state. +--- + src/window.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/window.c b/src/window.c +index 1ec0e02c..e9760386 100644 +--- a/src/window.c ++++ b/src/window.c +@@ -2620,11 +2620,7 @@ gboolean xa_treeview_mouse_button_press (GtkWidget *widget, GdkEventButton *even + + if (event->button == 1) + { +- GdkModifierType state; +- +- gdk_event_get_state((GdkEvent *) event, &state); +- +- if (gtk_tree_selection_iter_is_selected(selection, &iter) && ((state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) == 0)) ++ if (gtk_tree_selection_iter_is_selected(selection, &iter) && ((event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) == 0)) + return TRUE; + else + return FALSE; + +From 5d18fd23e8242678dbe47c232bc60b47f8fd75b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ingo=20Br=C3=BCckl?= +Date: Sat, 2 Jul 2022 23:51:40 +0200 +Subject: [PATCH 2/2] Re-enable left mouse button double clicks + +Check the time between two left mouse button clicks and if they are +fast enough, fake a double-click event. + +Left mouse button double clicks have been unintentionally disabled by +the change in commit e81d108c429e29b13ef1759c05033a6f3c645ac1 in order +to allow dragging of multiple rows. + +This fixes github issue #148, reported by aianson. +--- + src/window.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/window.c b/src/window.c +index e9760386..b9591aed 100644 +--- a/src/window.c ++++ b/src/window.c +@@ -2597,6 +2597,7 @@ void xa_location_entry_activated (GtkEntry *entry,gpointer user_data) + + gboolean xa_treeview_mouse_button_press (GtkWidget *widget, GdkEventButton *event, XArchive *archive) + { ++ static guint32 last_button1; + XEntry *entry; + GtkTreePath *path; + GtkTreeIter iter; +@@ -2620,10 +2621,17 @@ gboolean xa_treeview_mouse_button_press (GtkWidget *widget, GdkEventButton *even + + if (event->button == 1) + { ++ if (event->time - last_button1 > 250) ++ { ++ last_button1 = event->time; ++ + if (gtk_tree_selection_iter_is_selected(selection, &iter) && ((event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) == 0)) + return TRUE; + else + return FALSE; ++ } ++ else ++ event->button = 2; + } + + if (!gtk_tree_selection_iter_is_selected(selection, &iter)) diff --git a/srcpkgs/xarchiver/template b/srcpkgs/xarchiver/template index 56c781bea0dd..c0403f69ac47 100644 --- a/srcpkgs/xarchiver/template +++ b/srcpkgs/xarchiver/template @@ -1,7 +1,7 @@ # Template file for 'xarchiver' pkgname=xarchiver version=0.5.4.18 -revision=1 +revision=2 build_style=gnu-configure configure_args="--disable-doc --enable-gtk2=no" hostmakedepends="pkg-config intltool"