]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/clipbrd.cpp
avoiding reentrancy problems and congestion
[wxWidgets.git] / src / gtk / clipbrd.cpp
index 8b3d228a4f3394cd3c045051ca3c64589a19596b..e41b5e654cad13c69ab2efb60171c7f054814447 100644 (file)
@@ -434,6 +434,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
 wxClipboard::wxClipboard()
 {
+    m_idSelectionGetHandler = 0;
+
     m_open = false;
 
     m_dataPrimary =
@@ -642,9 +644,13 @@ bool wxClipboard::AddData( wxDataObject *data )
         AddSupportedTarget(format);
     }
 
-    g_signal_connect (m_clipboardWidget, "selection_get",
+    if ( !m_idSelectionGetHandler )
+    {
+        m_idSelectionGetHandler = g_signal_connect (
+                      m_clipboardWidget, "selection_get",
                       G_CALLBACK (selection_handler),
                       GUINT_TO_POINTER (gtk_get_current_event_time()) );
+    }
 
     // tell the world we offer clipboard data
     return SetSelectionOwner();