summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-09 13:31:22 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-09 13:38:49 (GMT)
commitd17b710fa945276b186a67abf05844095583738e (patch)
tree58f098fe4bc45b096a11f7ac1ee701257250b1a3
parent1eb19587bf3d96712d8d3313ecb32e92e1fcbd30 (diff)
downloadnetsurf-d17b710fa945276b186a67abf05844095583738e.tar.gz
netsurf-d17b710fa945276b186a67abf05844095583738e.tar.bz2
GTK: Corewindow: Fix modifier keys on mouse click.
Modifiers were getting unset for the click (release) events.
-rw-r--r--frontends/gtk/corewindow.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/frontends/gtk/corewindow.c b/frontends/gtk/corewindow.c
index 53ee173..6ca5d22 100644
--- a/frontends/gtk/corewindow.c
+++ b/frontends/gtk/corewindow.c
@@ -145,6 +145,7 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
{
struct nsgtk_corewindow *nsgtk_cw = (struct nsgtk_corewindow *)g;
struct nsgtk_corewindow_mouse *mouse = &nsgtk_cw->mouse_state;
+ bool was_drag = false;
/* only button 1 clicks are considered double clicks. If the
* mouse state is PRESS then we are waiting for a release to
@@ -168,9 +169,11 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
} else if (mouse->state & BROWSER_MOUSE_HOLDING_1) {
mouse->state ^= (BROWSER_MOUSE_HOLDING_1 |
BROWSER_MOUSE_DRAG_ON);
+ was_drag = true;
} else if (mouse->state & BROWSER_MOUSE_HOLDING_2) {
mouse->state ^= (BROWSER_MOUSE_HOLDING_2 |
BROWSER_MOUSE_DRAG_ON);
+ was_drag = true;
}
/* Handle modifiers being removed */
@@ -188,9 +191,10 @@ nsgtk_cw_button_release_event(GtkWidget *widget,
}
/* end drag with modifiers */
- if (mouse->state & (BROWSER_MOUSE_MOD_1 |
- BROWSER_MOUSE_MOD_2 |
- BROWSER_MOUSE_MOD_3)) {
+ if (was_drag && (mouse->state & (
+ BROWSER_MOUSE_MOD_1 |
+ BROWSER_MOUSE_MOD_2 |
+ BROWSER_MOUSE_MOD_3))) {
mouse->state = BROWSER_MOUSE_HOVER;
}