summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-05-16 10:12:09 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-24 10:36:16 +0200
commitf7d2bf216afa10268e6a7c1d4613a2fd8f7c7f3c (patch)
treea7a36402f4d630b4bc9006ba153018a4bf2fa2d9 /vcl/source
parentc05f35f4f56a1e65b92f4b1bc43b0fa6138d209c (diff)
Resolves: tdf#103174 & rhbz#1367846 improve gtk3 trackpad scrolling
convert number of "lines" scrolled to double and allow fractional parts of lines/columns Change-Id: Ib99c815cfc8823e22fc1d76e201903c34ed0f61b Related: rhbz#1367846 queue and merge scroll events Reviewed-on: https://gerrit.libreoffice.org/37779 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7f60978b2ccd0e17816b78bde60c6e0e60a9d52e) Change-Id: Ib45f61bbb35bd240829491ac8a79803222974778 Reviewed-on: https://gerrit.libreoffice.org/37913 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/commandevent.cxx4
-rw-r--r--vcl/source/window/window2.cxx14
2 files changed, 9 insertions, 9 deletions
diff --git a/vcl/source/window/commandevent.cxx b/vcl/source/window/commandevent.cxx
index e7f7dcd8569d..8ef928f3a571 100644
--- a/vcl/source/window/commandevent.cxx
+++ b/vcl/source/window/commandevent.cxx
@@ -73,7 +73,7 @@ CommandWheelData::CommandWheelData()
{
mnDelta = 0;
mnNotchDelta = 0;
- mnLines = 0;
+ mnLines = 0.0;
mnWheelMode = CommandWheelMode::NONE;
mnCode = 0;
mbHorz = false;
@@ -81,7 +81,7 @@ CommandWheelData::CommandWheelData()
}
CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- sal_uLong nScrollLines,
+ double nScrollLines,
CommandWheelMode nWheelMode, sal_uInt16 nKeyModifier,
bool bHorz, bool bDeltaIsPixel )
{
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 24d1fa79eae2..9607be6e3d21 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -664,7 +664,7 @@ long Window::GetDrawPixel( OutputDevice* pDev, long nPixels ) const
return nP;
}
-static void lcl_HandleScrollHelper( ScrollBar* pScrl, long nN, bool isMultiplyByLineSize )
+static void lcl_HandleScrollHelper( ScrollBar* pScrl, double nN, bool isMultiplyByLineSize )
{
if ( pScrl && nN && pScrl->IsEnabled() && pScrl->IsInputEnabled() && ! pScrl->IsInModalMode() )
{
@@ -681,7 +681,7 @@ static void lcl_HandleScrollHelper( ScrollBar* pScrl, long nN, bool isMultiplyBy
nN*=pScrl->GetLineSize();
}
- const double fVal = (double)(nNewPos - nN);
+ const double fVal = nNewPos - nN;
if ( fVal < LONG_MIN )
nNewPos = LONG_MIN;
@@ -737,8 +737,8 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
{
if (!pData->IsDeltaPixel())
{
- sal_uLong nScrollLines = pData->GetScrollLines();
- long nLines;
+ double nScrollLines = pData->GetScrollLines();
+ double nLines;
if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
{
if ( pData->GetDelta() < 0 )
@@ -747,7 +747,7 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
nLines = LONG_MAX;
}
else
- nLines = pData->GetNotchDelta() * (long)nScrollLines;
+ nLines = pData->GetNotchDelta() * nScrollLines;
if ( nLines )
{
ImplHandleScroll( nullptr,
@@ -860,8 +860,8 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
// horizontal or vertical scroll bar. nY is correspondingly either
// the horizontal or vertical scroll amount.
-void Window::ImplHandleScroll( ScrollBar* pHScrl, long nX,
- ScrollBar* pVScrl, long nY )
+void Window::ImplHandleScroll( ScrollBar* pHScrl, double nX,
+ ScrollBar* pVScrl, double nY )
{
lcl_HandleScrollHelper( pHScrl, nX, true );
lcl_HandleScrollHelper( pVScrl, nY, true );