[libadwaita/libadwaita-1-1] tab-box: Claim the sequence on press for middle click



commit 1c8f3ffa08c6da26ff25aeb18b615a3f65c35b76
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun May 1 21:58:50 2022 +0400

    tab-box: Claim the sequence on press for middle click
    
    Make it work with window handles.
    
    Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/471
    
    
    (cherry picked from commit 50db2aa22d3dfc1afc2b3f6e90758305865c8b20)

 src/adw-tab-box.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 1af2cb6d..54178555 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -2784,8 +2784,11 @@ pressed_cb (AdwTabBox  *self,
 
   button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
 
-  if (button == GDK_BUTTON_MIDDLE)
+  if (button == GDK_BUTTON_MIDDLE) {
+    gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
+
     return;
+  }
 
   if (button != GDK_BUTTON_PRIMARY) {
     gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_DENIED);
@@ -2825,7 +2828,6 @@ released_cb (AdwTabBox  *self,
   button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
 
   if (button == GDK_BUTTON_MIDDLE) {
-    gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
     adw_tab_view_close_page (self->view, info->page);
 
     return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]