X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3eef425f9a7387d771c1539bdf5e3f02060eb334..fada8bef05c36e3bae29f9442f8d32b024905207:/src/gtk/clipbrd.cpp diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 24b9da8278..15ffd8be44 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -362,10 +362,12 @@ async_targets_selection_received( GtkWidget *WXUNUSED(widget), return; wxClipboardEvent *event = new wxClipboardEvent(wxEVT_CLIPBOARD_CHANGED); + event->SetEventObject( clipboard ); if ( !selection_data || selection_data->length <= 0 ) { clipboard->m_sink->QueueEvent( event ); + clipboard->m_sink.Release(); return; } @@ -379,6 +381,7 @@ async_targets_selection_received( GtkWidget *WXUNUSED(widget), _T("got unsupported clipboard target") ); clipboard->m_sink->QueueEvent( event ); + clipboard->m_sink.Release(); return; } } @@ -404,6 +407,7 @@ async_targets_selection_received( GtkWidget *WXUNUSED(widget), } clipboard->m_sink->QueueEvent( event ); + clipboard->m_sink.Release(); } } @@ -520,8 +524,12 @@ void wxClipboard::AddSupportedTarget(GdkAtom atom) bool wxClipboard::IsSupportedAsync(wxEvtHandler *sink) { + if (m_sink.get()) + return false; // currently busy, come back later + + wxCHECK_MSG( sink, false, wxT("no sink given") ); + m_sink = sink; - gtk_selection_convert( m_targetsWidgetAsync, GTKGetClipboardAtom(), g_targetsAtom,