diff options
author | Neil <nyamatongwe@gmail.com> | 2017-06-12 13:49:46 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-06-12 13:49:46 +1000 |
commit | c94124bb05c4386863c160bb44d5592ba4fe989e (patch) | |
tree | 5086197e32cbf91efb8edd7e87f16a7d99cfead7 /gtk | |
parent | e015bc583b10e4f3a9889c9ae296de000d1d4646 (diff) | |
download | scintilla-mirror-c94124bb05c4386863c160bb44d5592ba4fe989e.tar.gz |
Backport: Simplify mouse and keyboard handling by only retaining the 'WithModifiers" form.
All events include a set of keyboard modifier flags.
Older calls that passed individual parameters for each key were removed.
Backport of changeset 6310:af83baede430.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/ScintillaGTK.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 1cd94e7ef..3def49966 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1775,7 +1775,11 @@ gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) { // If mouse released on scroll bar then the position is relative to the // scrollbar, not the drawing window so just repeat the most recent point. pt = sciThis->ptMouseLast; - sciThis->ButtonUp(pt, event->time, (event->state & GDK_CONTROL_MASK) != 0); + const int modifiers = ModifierFlags( + (event->state & GDK_SHIFT_MASK) != 0, + (event->state & GDK_CONTROL_MASK) != 0, + (event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0); + sciThis->ButtonUpWithModifiers(pt, event->time, modifiers); } } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; @@ -1912,10 +1916,11 @@ gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) { //Platform::DebugPrintf("Move %x %x %d %c %d %d\n", // sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y); Point pt(x, y); - int modifiers = ((event->state & GDK_SHIFT_MASK) != 0 ? SCI_SHIFT : 0) | - ((event->state & GDK_CONTROL_MASK) != 0 ? SCI_CTRL : 0) | - ((event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0 ? SCI_ALT : 0); - sciThis->ButtonMoveWithModifiers(pt, modifiers); + const int modifiers = ModifierFlags( + (event->state & GDK_SHIFT_MASK) != 0, + (event->state & GDK_CONTROL_MASK) != 0, + (event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0); + sciThis->ButtonMoveWithModifiers(pt, event->time, modifiers); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } |