[libadwaita/wip/exalm/tab-crash: 11/11] tab-box: Fix long press handling




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

    tab-box: Fix long press handling

 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 e66ef47d..0b1c7168 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -2871,19 +2871,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]