[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 14 15:51:19 UTC 2019


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

New commits:
commit a735c2d51bd9a73e5b9aae29d5dd224bf76cb99a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 13 14:32:42 2019 +0000
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Nov 14 16:50:30 2019 +0100

    ensure we connect just once
    
    Change-Id: Icd403eac948f0ead1f08a5a2e3a46e9b6bf33792
    Reviewed-on: https://gerrit.libreoffice.org/82626
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 572dee1f08b9..2262e52179fe 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1631,13 +1631,15 @@ public:
 
     virtual void connect_key_press(const Link<const KeyEvent&, bool>& rLink) override
     {
-        m_nKeyPressSignalId = g_signal_connect(m_pWidget, "key-press-event", G_CALLBACK(signalKey), this);
+        if (!m_nKeyPressSignalId)
+            m_nKeyPressSignalId = g_signal_connect(m_pWidget, "key-press-event", G_CALLBACK(signalKey), this);
         weld::Widget::connect_key_press(rLink);
     }
 
     virtual void connect_key_release(const Link<const KeyEvent&, bool>& rLink) override
     {
-        m_nKeyReleaseSignalId = g_signal_connect(m_pWidget, "key-release-event", G_CALLBACK(signalKey), this);
+        if (!m_nKeyReleaseSignalId)
+            m_nKeyReleaseSignalId = g_signal_connect(m_pWidget, "key-release-event", G_CALLBACK(signalKey), this);
         weld::Widget::connect_key_release(rLink);
     }
 
@@ -1650,14 +1652,16 @@ public:
     virtual void connect_mouse_move(const Link<const MouseEvent&, bool>& rLink) override
     {
         ensureEventWidget();
-        m_nMotionSignalId = g_signal_connect(m_pMouseEventBox, "motion-notify-event", G_CALLBACK(signalMotion), this);
+        if (!m_nMotionSignalId)
+            m_nMotionSignalId = g_signal_connect(m_pMouseEventBox, "motion-notify-event", G_CALLBACK(signalMotion), this);
         weld::Widget::connect_mouse_move(rLink);
     }
 
     virtual void connect_mouse_release(const Link<const MouseEvent&, bool>& rLink) override
     {
         ensureEventWidget();
-        m_nButtonReleaseSignalId = g_signal_connect(m_pMouseEventBox, "button-release-event", G_CALLBACK(signalButton), this);
+        if (!m_nButtonReleaseSignalId)
+            m_nButtonReleaseSignalId = g_signal_connect(m_pMouseEventBox, "button-release-event", G_CALLBACK(signalButton), this);
         weld::Widget::connect_mouse_release(rLink);
     }
 
@@ -2009,19 +2013,22 @@ public:
 
     virtual void connect_focus_in(const Link<Widget&, void>& rLink) override
     {
-        m_nFocusInSignalId = g_signal_connect(m_pWidget, "focus-in-event", G_CALLBACK(signalFocusIn), this);
+        if (!m_nFocusInSignalId)
+            m_nFocusInSignalId = g_signal_connect(m_pWidget, "focus-in-event", G_CALLBACK(signalFocusIn), this);
         weld::Widget::connect_focus_in(rLink);
     }
 
     virtual void connect_mnemonic_activate(const Link<Widget&, bool>& rLink) override
     {
-        m_nMnemonicActivateSignalId = g_signal_connect(m_pWidget, "mnemonic-activate", G_CALLBACK(signalMnemonicActivate), this);
+        if (!m_nMnemonicActivateSignalId)
+            m_nMnemonicActivateSignalId = g_signal_connect(m_pWidget, "mnemonic-activate", G_CALLBACK(signalMnemonicActivate), this);
         weld::Widget::connect_mnemonic_activate(rLink);
     }
 
     virtual void connect_focus_out(const Link<Widget&, void>& rLink) override
     {
-        m_nFocusOutSignalId = g_signal_connect(m_pWidget, "focus-out-event", G_CALLBACK(signalFocusOut), this);
+        if (!m_nFocusOutSignalId)
+            m_nFocusOutSignalId = g_signal_connect(m_pWidget, "focus-out-event", G_CALLBACK(signalFocusOut), this);
         weld::Widget::connect_focus_out(rLink);
     }
 
@@ -7340,8 +7347,11 @@ public:
     virtual void connect_visible_range_changed(const Link<weld::TreeView&, void>& rLink) override
     {
         weld::TreeView::connect_visible_range_changed(rLink);
-        GtkAdjustment* pVAdjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(m_pTreeView));
-        m_nVAdjustmentChangedSignalId = g_signal_connect(pVAdjustment, "value-changed", G_CALLBACK(signalVAdjustmentChanged), this);
+        if (!m_nVAdjustmentChangedSignalId)
+        {
+            GtkAdjustment* pVAdjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(m_pTreeView));
+            m_nVAdjustmentChangedSignalId = g_signal_connect(pVAdjustment, "value-changed", G_CALLBACK(signalVAdjustmentChanged), this);
+        }
     }
 
     virtual bool is_selected(const weld::TreeIter& rIter) const override
@@ -9905,13 +9915,15 @@ public:
 
     virtual void connect_focus_in(const Link<Widget&, void>& rLink) override
     {
-        m_nToggleFocusInSignalId = g_signal_connect(m_pToggleButton, "focus-in-event", G_CALLBACK(signalFocusIn), this);
+        if (!m_nToggleFocusInSignalId)
+            m_nToggleFocusInSignalId = g_signal_connect(m_pToggleButton, "focus-in-event", G_CALLBACK(signalFocusIn), this);
         weld::Widget::connect_focus_in(rLink);
     }
 
     virtual void connect_focus_out(const Link<Widget&, void>& rLink) override
     {
-        m_nToggleFocusOutSignalId = g_signal_connect(m_pToggleButton, "focus-out-event", G_CALLBACK(signalFocusOut), this);
+        if (!m_nToggleFocusOutSignalId)
+            m_nToggleFocusOutSignalId = g_signal_connect(m_pToggleButton, "focus-out-event", G_CALLBACK(signalFocusOut), this);
         weld::Widget::connect_focus_out(rLink);
     }
 


More information about the Libreoffice-commits mailing list