]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/clipbrd.cpp
revert nested event loop support for wxGTK1 because it causes applications hangs
[wxWidgets.git] / src / gtk / clipbrd.cpp
index aeb6af2ea06ac2538ace64d70cde2ebfd08e342f..c1c9c9c99bddf6fbf0e00db473919e25f0a167a4 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/gtk/clipbrd.cpp
 // Purpose:     wxClipboard implementation for wxGTK
 // Author:      Robert Roebling, Vadim Zeitlin
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 //              (c) 2007 Vadim Zeitlin
 // Licence:     wxWindows licence
@@ -328,7 +327,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
     {
         gtk_selection_data_set(
             selection_data,
-            GDK_SELECTION_TYPE_STRING,
+            format.GetFormatId(),
             8*sizeof(gchar),
             (const guchar*)buf.data(),
             size );
@@ -434,6 +433,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
 wxClipboard::wxClipboard()
 {
+    m_idSelectionGetHandler = 0;
+
     m_open = false;
 
     m_dataPrimary =
@@ -642,9 +643,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();