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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 14 11:08:11 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)

New commits:
commit 77881a62a6ca003074dcfcb1359d73d689800a15
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 13 14:32:42 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 14 12:06:28 2019 +0100

    ensure we connect just once
    
    Change-Id: Icd403eac948f0ead1f08a5a2e3a46e9b6bf33792
    Reviewed-on: https://gerrit.libreoffice.org/82624
    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 f3ec6ddfb71e..398a194230b6 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2163,13 +2163,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);
     }
 
@@ -2182,16 +2184,20 @@ 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);
-        m_nLeaveSignalId = g_signal_connect(m_pMouseEventBox, "leave-notify-event", G_CALLBACK(signalCrossing), this);
-        m_nEnterSignalId = g_signal_connect(m_pMouseEventBox, "enter-notify-event", G_CALLBACK(signalCrossing), this);
+        if (!m_nMotionSignalId)
+            m_nMotionSignalId = g_signal_connect(m_pMouseEventBox, "motion-notify-event", G_CALLBACK(signalMotion), this);
+        if (!m_nLeaveSignalId)
+            m_nLeaveSignalId = g_signal_connect(m_pMouseEventBox, "leave-notify-event", G_CALLBACK(signalCrossing), this);
+        if (!m_nEnterSignalId)
+            m_nEnterSignalId = g_signal_connect(m_pMouseEventBox, "enter-notify-event", G_CALLBACK(signalCrossing), 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);
     }
 
@@ -2573,19 +2579,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);
     }
 
@@ -8899,8 +8908,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
@@ -11918,13 +11930,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