vcl/unx/gtk3/gtk3gtkinst.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
New commits: commit 84be319c26ddae9a4022ffc1d01a3f4fa82e3a3e Author: Caolán McNamara <caol...@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/55010 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 737bd4a3959c..e956f4a3c93b 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3661,6 +3661,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; @@ -3790,17 +3791,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; @@ -3808,8 +3808,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); @@ -3828,7 +3828,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); @@ -3868,6 +3868,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)) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits