[arch-commits] Commit in libreoffice-fresh/trunk (2 files)

Andreas Radke andyrtr at archlinux.org
Sun Aug 28 19:50:05 UTC 2016


    Date: Sunday, August 28, 2016 @ 19:50:05
  Author: andyrtr
Revision: 274781

upgpkg: libreoffice-fresh 5.2.0-4

fix mouse wheel scrolling; FS#49827

Added:
  libreoffice-fresh/trunk/fix_gtk3_smooth_scolling.diff
Modified:
  libreoffice-fresh/trunk/PKGBUILD

-------------------------------+
 PKGBUILD                      |   11 ++
 fix_gtk3_smooth_scolling.diff |  157 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 165 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-08-28 18:56:09 UTC (rev 274780)
+++ PKGBUILD	2016-08-28 19:50:05 UTC (rev 274781)
@@ -13,7 +13,7 @@
 pkgname=('libreoffice-fresh-sdk' 'libreoffice-fresh')
 _LOver=5.2.0.4
 pkgver=5.2.0
-pkgrel=3
+pkgrel=4
 arch=('i686' 'x86_64')
 license=('LGPL3')
 url="http://www.libreoffice.org/"
@@ -65,7 +65,8 @@
 	libreoffice-fresh.sh libreoffice-fresh.csh
 	update_liborcus_to_0.11.0.diff
 	remove_unnecessary_orcus_external_usage_from_makefiles.diff
-	buildfix.diff)
+	buildfix.diff
+	fix_gtk3_smooth_scolling.diff)
 noextract=(boost_1_60_0.tar.bz2
 	ce12af00283eb90d9281956524250d6e-xmlsec1-1.2.20.tar.gz
 	35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
@@ -128,7 +129,8 @@
          'e7e4b3e70e99e5cba8f8dfcacf3b0d87'
          '3f526b966a672d1237cfcbadae0e3f95'
          'ac71e21ecc0976b2ea6e233854963d4b'
-         'd386f3a0b484cd3929329a294159f5bc')
+         'd386f3a0b484cd3929329a294159f5bc'
+         '7e827ccdda93cc70e94a0766c0509a11')
 
 prepare() {
 
@@ -144,6 +146,9 @@
 	# https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-5-2&id=e13db0f16c4ac5a243587e881d7b18979d07f478
 	patch -Np1 -i ../buildfix.diff
 
+	# https://cgit.freedesktop.org/libreoffice/core/patch/?id=3e60438dad304c487973fb8cdb50f3d94932af2e
+        patch -Np1 -i ../fix_gtk3_smooth_scolling.diff
+
 	# don't run broken tests on i686
 	[ "$CARCH" = "i686" ] && sed -i "/CppunitTest_sw_ooxmlexport7/d" sw/Module_sw.mk
 	

Added: fix_gtk3_smooth_scolling.diff
===================================================================
--- fix_gtk3_smooth_scolling.diff	                        (rev 0)
+++ fix_gtk3_smooth_scolling.diff	2016-08-28 19:50:05 UTC (rev 274781)
@@ -0,0 +1,157 @@
+From 3e60438dad304c487973fb8cdb50f3d94932af2e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Thu, 23 Jun 2016 17:32:11 +0100
+Subject: Resolves: rhbz#1349501 gtk3: smooth scrolling events can be
+ disabled...
+
+by the user with GDK_CORE_DEVICE_EVENTS=1, and so manage to disable their wheel
+scrolling
+
+Change-Id: I7df63f738983c90dea75b9f43a36133910446aba
+(cherry picked from commit 7dfd50f947671d79b9119f10259857700d5728d8)
+
+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
+Reviewed-on: https://gerrit.libreoffice.org/26645
+Tested-by: Jenkins <ci at libreoffice.org>
+Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
+
+diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
+index e8d12e3..2b7ade6 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 );
+@@ -2664,9 +2664,6 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEventScroll* pEvent, gpointer
+ {
+     UpdateLastInputEventTime(pEvent->time);
+ 
+-    if (pEvent->direction != GDK_SCROLL_SMOOTH)
+-        return false;
+-
+     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+ 
+     SalWheelMouseEvent aEvent;
+@@ -2679,36 +2676,74 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEventScroll* pEvent, gpointer
+     aEvent.mnY = (sal_uLong)pEvent->y;
+     aEvent.mnCode = GetMouseModCode( pEvent->state );
+ 
+-    // 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
+-    // and divide that by 40 to get the number of scrollines
+-    if (pEvent->delta_x != 0.0)
++    switch (pEvent->direction)
+     {
+-        aEvent.mnDelta = -pEvent->delta_x * 120;
+-        aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
+-        if (aEvent.mnDelta == 0)
+-            aEvent.mnDelta = aEvent.mnNotchDelta;
+-        aEvent.mbHorz = true;
+-        aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
+-        if (aEvent.mnScrollLines == 0)
+-            aEvent.mnScrollLines = 1;
++        case GDK_SCROLL_SMOOTH:
++            // 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
++            // and divide that by 40 to get the number of scrollines
++            if (pEvent->delta_x != 0.0)
++            {
++                aEvent.mnDelta = -pEvent->delta_x * 120;
++                aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
++                if (aEvent.mnDelta == 0)
++                    aEvent.mnDelta = aEvent.mnNotchDelta;
++                aEvent.mbHorz = true;
++                aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
++                if (aEvent.mnScrollLines == 0)
++                    aEvent.mnScrollLines = 1;
++
++                pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++            }
+ 
+-        pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
+-    }
++            if (pEvent->delta_y != 0.0)
++            {
++                aEvent.mnDelta = -pEvent->delta_y * 120;
++                aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
++                if (aEvent.mnDelta == 0)
++                    aEvent.mnDelta = aEvent.mnNotchDelta;
++                aEvent.mbHorz = false;
++                aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
++                if (aEvent.mnScrollLines == 0)
++                    aEvent.mnScrollLines = 1;
++
++                pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++            }
+ 
+-    if (pEvent->delta_y != 0.0)
+-    {
+-        aEvent.mnDelta = -pEvent->delta_y * 120;
+-        aEvent.mnNotchDelta = aEvent.mnDelta < 0 ? -1 : +1;
+-        if (aEvent.mnDelta == 0)
+-            aEvent.mnDelta = aEvent.mnNotchDelta;
+-        aEvent.mbHorz = false;
+-        aEvent.mnScrollLines = std::abs(aEvent.mnDelta) / 40;
+-        if (aEvent.mnScrollLines == 0)
+-            aEvent.mnScrollLines = 1;
++            break;
++
++        case GDK_SCROLL_UP:
++            aEvent.mnDelta = 120;
++            aEvent.mnNotchDelta = 1;
++            aEvent.mnScrollLines = 3;
++            aEvent.mbHorz = false;
++            pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++            break;
++
++        case GDK_SCROLL_DOWN:
++            aEvent.mnDelta = -120;
++            aEvent.mnNotchDelta = -1;
++            aEvent.mnScrollLines = 3;
++            aEvent.mbHorz = false;
++            pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++            break;
++
++        case GDK_SCROLL_LEFT:
++            aEvent.mnDelta = 120;
++            aEvent.mnNotchDelta = 1;
++            aEvent.mnScrollLines = 3;
++            aEvent.mbHorz = true;
++            pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++            break;
+ 
+-        pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++        case GDK_SCROLL_RIGHT:
++            aEvent.mnDelta = -120;
++            aEvent.mnNotchDelta = -1;
++            aEvent.mnScrollLines = 3;
++            aEvent.mbHorz = true;
++            pThis->CallCallback(SalEvent::WheelMouse, &aEvent);
++            break;
+     }
+ 
+     return true;
+-- 
+cgit v0.10.2



More information about the arch-commits mailing list