summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-24 20:59:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-24 21:04:01 +0100
commit053a843bccaef2d2323be3ddff6217c592a4c5db (patch)
treeeec3d82479541b1ec74a6208db4bbeedf8109e24
parentb72c14f68b317b27be12a2432cdeae351537d57a (diff)
Resolves: rhbz#1349501 gtk3: smooth scrolling events can be disabled...
better fix, if we listen to the eventbox we get either SMOOTH scrolling or not smooth events, not both. We get SMOOTH when supported, and not if not supported so no need to reintroduce the miserable hack, which doesn't work under wayland anyway Change-Id: I993e71d3553322425a506cd93d812efe081bf3c9
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx1
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx12
2 files changed, 1 insertions, 12 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index e455f9e47b12..ff5c45432574 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -213,7 +213,6 @@ class GtkSalFrame : public SalFrame
#if GTK_CHECK_VERSION(3,0,0)
OUString m_aTooltip;
Rectangle m_aHelpArea;
- guint32 m_nLastScrollEventTime;
long m_nWidthRequest;
long m_nHeightRequest;
cairo_region_t* m_pRegion;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index aef66c0a00e4..7e3600b7e0b6 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1013,6 +1013,7 @@ void GtkSalFrame::InitCommon()
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "drag-failed", G_CALLBACK(signalDragFailed), this ));
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "drag-data-delete", G_CALLBACK(signalDragDelete), this ));
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "drag-data-get", G_CALLBACK(signalDragDataGet), this ));
+ m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "scroll-event", G_CALLBACK(signalScroll), this ));
g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this );
g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this );
@@ -1038,7 +1039,6 @@ void GtkSalFrame::InitCommon()
g_signal_connect( G_OBJECT(m_pWindow), "key-release-event", G_CALLBACK(signalKey), this );
g_signal_connect( G_OBJECT(m_pWindow), "delete-event", G_CALLBACK(signalDelete), this );
g_signal_connect( G_OBJECT(m_pWindow), "window-state-event", G_CALLBACK(signalWindowState), this );
- g_signal_connect( G_OBJECT(m_pWindow), "scroll-event", G_CALLBACK(signalScroll), this );
g_signal_connect( G_OBJECT(m_pWindow), "leave-notify-event", G_CALLBACK(signalCrossing), this );
g_signal_connect( G_OBJECT(m_pWindow), "enter-notify-event", G_CALLBACK(signalCrossing), this );
g_signal_connect( G_OBJECT(m_pWindow), "visibility-notify-event", G_CALLBACK(signalVisibility), this );
@@ -1051,7 +1051,6 @@ void GtkSalFrame::InitCommon()
m_bSpanMonitorsWhenFullscreen = false;
m_nState = GDK_WINDOW_STATE_WITHDRAWN;
m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED;
- m_nLastScrollEventTime = GDK_CURRENT_TIME;
m_bSendModChangeOnRelease = false;
m_pIMHandler = nullptr;
m_hBackgroundPixmap = None;
@@ -2658,13 +2657,6 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEventScroll* pEvent, gpointer
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- // gnome#726878 check for duplicate legacy scroll event
- if (pEvent->direction != GDK_SCROLL_SMOOTH &&
- pThis->m_nLastScrollEventTime == pEvent->time)
- {
- return false;
- }
-
SalWheelMouseEvent aEvent;
aEvent.mnTime = pEvent->time;
@@ -2678,8 +2670,6 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEventScroll* pEvent, gpointer
switch (pEvent->direction)
{
case GDK_SCROLL_SMOOTH:
- pThis->m_nLastScrollEventTime = pEvent->time;
-
// rhbz#1344042 "Traditionally" in gtk3 we tool a single up/down event as
// equating to 3 scroll lines and a delta of 120. So scale the delta here
// by 120 where a single mouse wheel click is an incoming delta_x of 1