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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 10 19:59:46 UTC 2020


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

New commits:
commit e0cfc66188908527039ed6238b8cc2442c5b15a1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Nov 10 17:04:31 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Nov 10 20:59:05 2020 +0100

    GtkExpander, like GtkCalendar needs to not let click through to vcl
    
    Change-Id: Ieccc019b423aa9271ce45a002672893c38f1986b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105562
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 6a82aa32eae5..db2b765841ff 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -16143,6 +16143,7 @@ class GtkInstanceExpander : public GtkInstanceContainer, public virtual weld::Ex
 private:
     GtkExpander* m_pExpander;
     gulong m_nSignalId;
+    gulong m_nButtonPressEventSignalId;
 
     static void signalExpanded(GtkExpander* pExpander, GParamSpec*, gpointer widget)
     {
@@ -16174,11 +16175,20 @@ private:
         pThis->signal_expanded();
     }
 
+    static gboolean signalButton(GtkWidget*, GdkEventButton*, gpointer)
+    {
+        // don't let button press get to parent window, for the case of the
+        // an expander in a sidebar where otherwise single click to expand
+        // doesn't work
+        return true;
+    }
+
 public:
     GtkInstanceExpander(GtkExpander* pExpander, GtkInstanceBuilder* pBuilder, bool bTakeOwnership)
         : GtkInstanceContainer(GTK_CONTAINER(pExpander), pBuilder, bTakeOwnership)
         , m_pExpander(pExpander)
         , m_nSignalId(g_signal_connect(m_pExpander, "notify::expanded", G_CALLBACK(signalExpanded), this))
+        , m_nButtonPressEventSignalId(g_signal_connect_after(m_pExpander, "button-press-event", G_CALLBACK(signalButton), this))
     {
     }
 
@@ -16194,6 +16204,7 @@ public:
 
     virtual ~GtkInstanceExpander() override
     {
+        g_signal_handler_disconnect(m_pExpander, m_nButtonPressEventSignalId);
         g_signal_handler_disconnect(m_pExpander, m_nSignalId);
     }
 };


More information about the Libreoffice-commits mailing list