vcl/unx/gtk3/gtkinst.cxx |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 2f901e483b5ab029a2f809acb68b49aafa2c77c3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jan 19 11:13:50 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Jan 19 14:03:30 2023 +0000

    save last mouse press location even if no handlers set
    
    Change-Id: I24ce412fd3b62843ee3fabc7a3fca36ae91c0222
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145784
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 6b658d24fae7..90055b3ecc57 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3010,6 +3010,14 @@ private:
                 return true;
         }
 
+        /* Save press to possibly begin a drag */
+        if (pEvent->type != GDK_BUTTON_RELEASE)
+        {
+            m_nPressedButton = pEvent->button;
+            m_nPressStartX = pEvent->x;
+            m_nPressStartY = pEvent->y;
+        }
+
         if (!m_aMousePressHdl.IsSet() && !m_aMouseReleaseHdl.IsSet())
             return false;
 
@@ -3060,14 +3068,6 @@ private:
                 return false;
         }
 
-        /* Save press to possibly begin a drag */
-        if (pEvent->type != GDK_BUTTON_RELEASE)
-        {
-            m_nPressedButton = pEvent->button;
-            m_nPressStartX = pEvent->x;
-            m_nPressStartY = pEvent->y;
-        }
-
         sal_uInt32 nModCode = GtkSalFrame::GetMouseModCode(pEvent->state);
         // strip out which buttons are involved from the nModCode and replace 
with m_nLastMouseButton
         sal_uInt16 nCode = m_nLastMouseButton | (nModCode & (KEY_SHIFT | 
KEY_MOD1 | KEY_MOD2));
commit a7a842f4a437216cba8cd623306506aa30db7d8e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jan 19 10:28:47 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Jan 19 14:03:23 2023 +0000

    use cairo_surface_destroy after gtk_drag_set_icon_surface
    
    Change-Id: Iac543121a809eeabae630d4a426e72d5f9d47057
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145783
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index c051da78b969..6b658d24fae7 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3135,6 +3135,7 @@ private:
             {
                 cairo_surface_t *surface = 
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0);
                 gtk_drag_set_icon_surface(pContext, surface);
+                cairo_surface_destroy(surface);
             }
 
             m_nPressedButton = -1;
@@ -3287,6 +3288,7 @@ private:
         {
             cairo_surface_t *surface = 
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0);
             gtk_drag_set_icon_surface(context, surface);
+            cairo_surface_destroy(surface);
         }
 #endif
         if (!m_xDragSource)

Reply via email to