[libadwaita/libadwaita-1-1] tab-box: Fix long press handling



commit 1446979e18c740da1fc83d3aa4c143606fef46e7
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Aug 23 19:26:50 2022 +0400

    tab-box: Fix long press handling
    
    
    (cherry picked from commit 34a62d7a9121ea154b6dc481d064a8999aedc030)

 src/adw-tab-box.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 011721de..26a8213d 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -2686,19 +2686,21 @@ long_pressed_cb (AdwTabBox  *self,
                  double      y,
                  GtkGesture *gesture)
 {
-  TabInfo *info = find_tab_info_at (self, x);
+  TabInfo *info;
+
+  x += gtk_adjustment_get_value (self->adjustment);
 
   gtk_gesture_set_state (self->drag_gesture, GTK_EVENT_SEQUENCE_DENIED);
 
+  info = find_tab_info_at (self, x);
+
   if (!info || !info->page) {
     gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_DENIED);
     return;
   }
 
-  x += gtk_adjustment_get_value (self->adjustment);
-
   gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
-  do_popup (self, self->pressed_tab, x, y);
+  do_popup (self, info, x, y);
 }
 
 static void


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