X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5027818a42043052ac375b1a0ba30fac491ddc4..9f9305c0d2a0c4aa55470c882a13861c284f6af2:/src/gtk/clipbrd.cpp diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index aeb6af2ea0..e41b5e654c 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -328,7 +328,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 +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();