[libhandy/wip/exalm/alpha-fixes: 7/8] tab-box: Handle middle click on release instead of press
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/exalm/alpha-fixes: 7/8] tab-box: Handle middle click on release instead of press
- Date: Thu, 11 Nov 2021 19:53:18 +0000 (UTC)
commit 874fb9bec09d4ce84e667d97a62db3d097b31835
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Nov 12 00:43:04 2021 +0500
tab-box: Handle middle click on release instead of press
Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/294
Backported from
https://gitlab.gnome.org/GNOME/libadwaita/-/commit/4e2ef2f5fd048afdb9f8a8866b55f389655db773
src/hdy-tab-box.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/hdy-tab-box.c b/src/hdy-tab-box.c
index 7953568d..14253107 100644
--- a/src/hdy-tab-box.c
+++ b/src/hdy-tab-box.c
@@ -2909,12 +2909,6 @@ hdy_tab_box_button_press_event (GtkWidget *widget,
self->pressed_button = event->button;
- if (self->pressed_button == GDK_BUTTON_MIDDLE) {
- hdy_tab_view_close_page (self->view, self->pressed_tab->page);
-
- return GDK_EVENT_STOP;
- }
-
if (self->pressed_button != GDK_BUTTON_PRIMARY)
return GDK_EVENT_PROPAGATE;
@@ -2961,13 +2955,20 @@ hdy_tab_box_button_release_event (GtkWidget *widget,
GdkEventButton *event)
{
HdyTabBox *self = HDY_TAB_BOX (widget);
+ gboolean ret = GDK_EVENT_PROPAGATE;
+
+ if (self->pressed_button == GDK_BUTTON_MIDDLE) {
+ hdy_tab_view_close_page (self->view, self->pressed_tab->page);
+
+ ret = GDK_EVENT_STOP;
+ }
self->pressed = FALSE;
self->pressed_button = 0;
end_dragging (self);
- return GDK_EVENT_PROPAGATE;
+ return ret;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]