diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-12-14 16:17:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-12-17 09:59:55 +0100 |
commit | 3efc0b2fe087fb8c5e0291efbda417b819a43f83 (patch) | |
tree | 70b2fce76fce8ed4abf2427a80fcb835a0dcc67a /vcl | |
parent | 264c0bd303fa77932959e4265d2dd05a29a4da09 (diff) |
drop scroll-wheel moves notebook page workaround
now that the double-decker monstrosity is in place
Change-Id: I8bc8f98d0cfd2bf4506bbc61632c1e7b0f9cd3f1
Reviewed-on: https://gerrit.libreoffice.org/65230
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index dffb42ced571..b9155e2da687 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3111,7 +3111,6 @@ private: gulong m_nSwitchPageSignalId; gulong m_nOverFlowSwitchPageSignalId; gulong m_nSizeAllocateSignalId; - gulong m_nScrollSignalId; bool m_bOverFlowBoxActive; bool m_bOverFlowBoxIsStart; int m_nStartTabCount; @@ -3206,59 +3205,6 @@ private: enable_notify_events(); } - static gboolean signalScroll(GtkWidget*, GdkEventScroll* event, gpointer widget) - { - GtkInstanceNotebook* pThis = static_cast<GtkInstanceNotebook*>(widget); - return pThis->signal_scroll(event); - } - - bool signal_scroll(GdkEventScroll* event) - { - GtkWidget* pEventWidget = gtk_get_event_widget(reinterpret_cast<GdkEvent*>(event)); - if (!pEventWidget) - return false; - - /* ignore page content scroll events */ - GtkWidget* pPage = gtk_notebook_get_nth_page(m_pNotebook, gtk_notebook_get_current_page(m_pNotebook)); - if (gtk_widget_is_ancestor(pEventWidget, pPage) || pPage == pEventWidget) - return false; - - bool bNext(false), bPrev(false); - switch (event->direction) - { - case GDK_SCROLL_RIGHT: - case GDK_SCROLL_DOWN: - bNext = true; - break; - case GDK_SCROLL_LEFT: - case GDK_SCROLL_UP: - bPrev = true; - break; - case GDK_SCROLL_SMOOTH: - { - switch (gtk_notebook_get_tab_pos(m_pNotebook)) - { - case GTK_POS_LEFT: - case GTK_POS_RIGHT: - bNext = event->delta_y > 0; - bPrev = event->delta_y < 0; - break; - case GTK_POS_TOP: - case GTK_POS_BOTTOM: - bNext = event->delta_x > 0; - bPrev = event->delta_x < 0; - break; - } - break; - } - } - if (bNext) - gtk_notebook_next_page(m_pNotebook); - else if (bPrev) - gtk_notebook_prev_page(m_pNotebook); - return true; - } - static OString get_page_ident(GtkNotebook *pNotebook, guint nPage) { const GtkWidget* pTabWidget = gtk_notebook_get_tab_label(pNotebook, gtk_notebook_get_nth_page(pNotebook, nPage)); @@ -3539,7 +3485,6 @@ public: , m_nEndTabCount(0) { gtk_widget_add_events(GTK_WIDGET(pNotebook), GDK_SCROLL_MASK); - m_nScrollSignalId = g_signal_connect(pNotebook, "scroll-event", G_CALLBACK(signalScroll), this); if (get_n_pages() > 6) m_nSizeAllocateSignalId = g_signal_connect_after(pNotebook, "size-allocate", G_CALLBACK(signalSizeAllocate), this); else @@ -3709,7 +3654,6 @@ public: { if (m_nSizeAllocateSignalId) g_signal_handler_disconnect(m_pNotebook, m_nSizeAllocateSignalId); - g_signal_handler_disconnect(m_pNotebook, m_nScrollSignalId); g_signal_handler_disconnect(m_pNotebook, m_nSwitchPageSignalId); g_signal_handler_disconnect(m_pOverFlowNotebook, m_nOverFlowSwitchPageSignalId); gtk_widget_destroy(GTK_WIDGET(m_pOverFlowNotebook)); |