[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 23 15:33:27 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 8b7f8f54a8ee35df98f8107a42981d3a0a659541
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 23 10:54:58 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 23 17:32:19 2019 +0200

    MouseRelease is expected to have n-clicks of last MousePress
    
    otherwise the IMapWnd and CountourWindow don't accept the double-click
    release as finishing polygon editing
    
    Change-Id: Iaab7a46cad2c5c92fdc2f8ff61135792fae67be8
    Reviewed-on: https://gerrit.libreoffice.org/72830
    Tested-by: Jenkins
    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 fa98e2e2e208..5a51f7074373 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1380,6 +1380,7 @@ private:
     bool m_bFrozen;
     bool m_bDraggedOver;
     sal_uInt16 m_nLastMouseButton;
+    sal_uInt16 m_nLastMouseClicks;
     gulong m_nFocusInSignalId;
     gulong m_nMnemonicActivateSignalId;
     gulong m_nFocusOutSignalId;
@@ -1431,8 +1432,6 @@ private:
 
     bool signal_button(GdkEventButton* pEvent)
     {
-        int nClicks = 1;
-
         SalEvent nEventType = SalEvent::NONE;
         switch (pEvent->type)
         {
@@ -1448,13 +1447,14 @@ private:
                     }
                 }
                 nEventType = SalEvent::MouseButtonDown;
+                m_nLastMouseClicks = 1;
                 break;
             case GDK_2BUTTON_PRESS:
-                nClicks = 2;
+                m_nLastMouseClicks = 2;
                 nEventType = SalEvent::MouseButtonDown;
                 break;
             case GDK_3BUTTON_PRESS:
-                nClicks = 3;
+                m_nLastMouseClicks = 3;
                 nEventType = SalEvent::MouseButtonDown;
                 break;
             case GDK_BUTTON_RELEASE:
@@ -1493,7 +1493,7 @@ private:
 
         sal_uInt32 nModCode = GtkSalFrame::GetMouseModCode(pEvent->state);
         sal_uInt16 nCode = m_nLastMouseButton | (nModCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2));
-        MouseEvent aMEvt(aPos, nClicks, ImplGetMouseButtonMode(m_nLastMouseButton, nModCode), nCode, nCode);
+        MouseEvent aMEvt(aPos, m_nLastMouseClicks, ImplGetMouseButtonMode(m_nLastMouseButton, nModCode), nCode, nCode);
 
         if (nEventType == SalEvent::MouseButtonDown)
         {
@@ -1581,6 +1581,7 @@ public:
         , m_bFrozen(false)
         , m_bDraggedOver(false)
         , m_nLastMouseButton(0)
+        , m_nLastMouseClicks(0)
         , m_nFocusInSignalId(0)
         , m_nMnemonicActivateSignalId(0)
         , m_nFocusOutSignalId(0)


More information about the Libreoffice-commits mailing list