summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2013-07-23 16:15:23 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2013-08-08 15:24:15 -0400
commit1da655c2eb41816f6bf13134fc950dee9dd99aaa (patch)
tree2e124827dd7790650ecad7095e66c48335fe54a1 /libs
parentc222acecaa38b1ef56754808f216dc1abecbd416 (diff)
Fix special handling of 'zoom vertical' scroll wheel modifier key.
gtkmm2ext/keyboard.cc has a special case to emit a signal on the key-up of the modifier key used to adjust track heights in conjunction with the scroll wheel, so that the same track continues to be resized even when it's shrunk to no longer be under the mouse cursor. However, this code assumed that the modifier key for this was <Shift>. Fix it to use the event->state bit corresponding to ScrollZoomVerticalModifier instead, and rename the relevant functions to clarify that it's the 'zoom vertical' modifier key they're dealing with. Partially fixes #5610.
Diffstat (limited to 'libs')
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/keyboard.h2
-rw-r--r--libs/gtkmm2ext/keyboard.cc11
2 files changed, 8 insertions, 5 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/keyboard.h b/libs/gtkmm2ext/gtkmm2ext/keyboard.h
index 84988e1525..2c6b026a42 100644
--- a/libs/gtkmm2ext/gtkmm2ext/keyboard.h
+++ b/libs/gtkmm2ext/gtkmm2ext/keyboard.h
@@ -164,7 +164,7 @@ class Keyboard : public sigc::trackable, PBD::Stateful
}
};
- sigc::signal0<void> ShiftReleased;
+ sigc::signal0<void> ZoomVerticalModifierReleased;
protected:
static Keyboard* _the_keyboard;
diff --git a/libs/gtkmm2ext/keyboard.cc b/libs/gtkmm2ext/keyboard.cc
index f694471d9a..5087f61a23 100644
--- a/libs/gtkmm2ext/keyboard.cc
+++ b/libs/gtkmm2ext/keyboard.cc
@@ -248,12 +248,15 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
keyval = event->keyval;
}
- if (keyval == GDK_Shift_L) {
+ if (event->state & ScrollZoomVerticalModifier) {
/* There is a special and rather hacky situation in Editor which makes
- it useful to know when a shift key has been released, so emit a signal
- here (see Editor::_stepping_axis_view)
+ it useful to know when the modifier key for vertical zoom has been
+ released, so emit a signal here (see Editor::_stepping_axis_view).
+ Note that the state bit for the modifier key is set for the key-up
+ event when the modifier is released, but not the key-down when it
+ is pressed, so we get here on key-up, which is what we want.
*/
- ShiftReleased (); /* EMIT SIGNAL */
+ ZoomVerticalModifierReleased (); /* EMIT SIGNAL */
}
if (event->type == GDK_KEY_PRESS) {