X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4c3d9409a22c4b4e86e04c0d39c65be5ec13859..9cb80f3fa331228864ebc13188a0168da36a4998:/src/gtk/clipbrd.cpp diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 924f7c88c0..f963bdd6ae 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -262,7 +262,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), if ( !clipboard ) return; - wxDataObject * const data = clipboard->GTKGetDataObject(); + wxDataObject * const data = clipboard->GTKGetDataObject(selection_data->selection); if ( !data ) return; @@ -729,4 +729,27 @@ bool wxClipboard::GetData( wxDataObject& data ) return false; } +wxDataObject* wxClipboard::GTKGetDataObject( GdkAtom atom ) +{ + if ( atom == GDK_NONE ) + return Data(); + + if ( atom == GDK_SELECTION_PRIMARY ) + { + wxLogTrace(TRACE_CLIPBOARD, wxT("Primary selection requested" )); + + return Data( wxClipboard::Primary ); + } + else if ( atom == g_clipboardAtom ) + { + wxLogTrace(TRACE_CLIPBOARD, wxT("Clipboard data requested" )); + + return Data( wxClipboard::Clipboard ); + } + else // some other selection, we're not concerned + { + return (wxDataObject*)NULL; + } +} + #endif // wxUSE_CLIPBOARD