summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/WheelEventGtk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/gtk/WheelEventGtk.cpp')
-rw-r--r--WebCore/platform/gtk/WheelEventGtk.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/WebCore/platform/gtk/WheelEventGtk.cpp b/WebCore/platform/gtk/WheelEventGtk.cpp
index 3368f25..fbe31f7 100644
--- a/WebCore/platform/gtk/WheelEventGtk.cpp
+++ b/WebCore/platform/gtk/WheelEventGtk.cpp
@@ -29,9 +29,11 @@
#include "PlatformWheelEvent.h"
#include <gdk/gdk.h>
+#include <gtk/gtkversion.h>
namespace WebCore {
+// Keep this in sync with the other platform event constructors
PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event)
{
static const float delta = 1;
@@ -57,12 +59,21 @@ PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event)
m_position = IntPoint((int)event->x, (int)event->y);
m_globalPosition = IntPoint((int)event->x_root, (int)event->y_root);
+ m_granularity = ScrollByLineWheelEvent;
m_isAccepted = false;
m_shiftKey = event->state & GDK_SHIFT_MASK;
m_ctrlKey = event->state & GDK_CONTROL_MASK;
m_altKey = event->state & GDK_MOD1_MASK;
- m_metaKey = event->state & GDK_MOD2_MASK;
- m_isContinuous = false;
+#if GTK_CHECK_VERSION(2,10,0)
+ m_metaKey = event->state & GDK_META_MASK;
+#else
+ // GDK_MOD2_MASK doesn't always mean meta so we can't use it
+ m_metaKey = false;
+#endif
+
+ // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
+ m_deltaX *= horizontalLineMultiplier();
+ m_deltaY *= verticalLineMultiplier();
}
}