[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/unx
Caolán McNamara
caolanm at redhat.com
Tue May 29 19:47:43 UTC 2018
vcl/unx/gtk3/gtk3gtkinst.cxx | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
New commits:
commit cb65109caf5ba5b2c04202464a435c658a4a1ccc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 29 14:23:03 2018 +0100
remember button pressed to reuse for move
Change-Id: I4a7f5bb8e46e190f33150f666a653bfc04957a0f
Reviewed-on: https://gerrit.libreoffice.org/55016
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 9a1d58098e74..28ef5090b1fd 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3647,6 +3647,7 @@ private:
ScopedVclPtrInstance<VirtualDevice> m_xDevice;
std::vector<unsigned char> m_aBuffer;
cairo_surface_t* m_pSurface;
+ sal_uInt16 m_nLastMouseButton;
gulong m_nDrawSignalId;
gulong m_nSizeAllocateSignalId;
gulong m_nButtonPressSignalId;
@@ -3776,17 +3777,16 @@ private:
return false;
}
- sal_uInt16 nButton;
switch (pEvent->button)
{
case 1:
- nButton = MOUSE_LEFT;
+ m_nLastMouseButton = MOUSE_LEFT;
break;
case 2:
- nButton = MOUSE_MIDDLE;
+ m_nLastMouseButton = MOUSE_MIDDLE;
break;
case 3:
- nButton = MOUSE_RIGHT;
+ m_nLastMouseButton = MOUSE_RIGHT;
break;
default:
return false;
@@ -3794,8 +3794,8 @@ private:
Point aPos(pEvent->x, pEvent->y);
sal_uInt32 nModCode = GtkSalFrame::GetMouseModCode(pEvent->state);
- sal_uInt16 nCode = nButton | (nModCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2));
- MouseEvent aMEvt(aPos, nClicks, ImplGetMouseButtonMode(nButton, nModCode), nCode, nCode);
+ sal_uInt16 nCode = m_nLastMouseButton | (nModCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2));
+ MouseEvent aMEvt(aPos, nClicks, ImplGetMouseButtonMode(m_nLastMouseButton, nModCode), nCode, nCode);
if (nEventType == SalEvent::MouseButtonDown)
m_aMousePressHdl.Call(aMEvt);
@@ -3814,7 +3814,7 @@ private:
{
Point aPos(pEvent->x, pEvent->y);
sal_uInt32 nModCode = GtkSalFrame::GetMouseModCode(pEvent->state);
- sal_uInt16 nCode = (nModCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2));
+ sal_uInt16 nCode = m_nLastMouseButton | (nModCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2));
MouseEvent aMEvt(aPos, 0, ImplGetMouseMoveMode(nModCode), nCode, nCode);
m_aMouseMotionHdl.Call(aMEvt);
@@ -3854,6 +3854,7 @@ public:
, m_pAccessible(nullptr)
, m_xDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT)
, m_pSurface(nullptr)
+ , m_nLastMouseButton(0)
, m_nDrawSignalId(g_signal_connect(m_pDrawingArea, "draw", G_CALLBACK(signalDraw), this))
, m_nSizeAllocateSignalId(g_signal_connect(m_pDrawingArea, "size_allocate", G_CALLBACK(signalSizeAllocate), this))
, m_nButtonPressSignalId(g_signal_connect(m_pDrawingArea, "button-press-event", G_CALLBACK(signalButton), this))
More information about the Libreoffice-commits
mailing list