summaryrefslogtreecommitdiffstats
path: root/src/event-context.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-07-23 18:09:51 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-07-23 18:09:51 +0000
commit63d5d807f1eb20be956cd33edc2a15d2dd31b5fe (patch)
treea0e3098c476106295cc63d784acaae94ce971fa1 /src/event-context.cpp
parentTranslations. Fix for Bug #1027904 (Toolbars not translated). (diff)
downloadinkscape-63d5d807f1eb20be956cd33edc2a15d2dd31b5fe.tar.gz
inkscape-63d5d807f1eb20be956cd33edc2a15d2dd31b5fe.zip
Fix canvas scroll events in GTK+ 3
Fixed bugs: - https://launchpad.net/bugs/1016892 (bzr r11566)
Diffstat (limited to 'src/event-context.cpp')
-rw-r--r--src/event-context.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/event-context.cpp b/src/event-context.cpp
index 3c0f369cb..bb3619877 100644
--- a/src/event-context.cpp
+++ b/src/event-context.cpp
@@ -691,6 +691,10 @@ static gint sp_event_context_private_root_handler(
int const wheel_scroll = prefs->getIntLimited(
"/options/wheelscroll/value", 40, 0, 1000);
+ // Size of smooth-scrolls (only used in GTK+ 3)
+ gdouble delta_x = 0;
+ gdouble delta_y = 0;
+
/* shift + wheel, pan left--right */
if (event->scroll.state & GDK_SHIFT_MASK) {
switch (event->scroll.direction) {
@@ -740,6 +744,12 @@ static gint sp_event_context_private_root_handler(
case GDK_SCROLL_RIGHT:
desktop->scroll_world(-wheel_scroll, 0);
break;
+#if GTK_CHECK_VERSION(3,0,0)
+ case GDK_SCROLL_SMOOTH:
+ gdk_event_get_scroll_deltas(event, &delta_x, &delta_y);
+ desktop->scroll_world(delta_x, delta_y);
+ break;
+#endif
}
}
break;