]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/clipbrd.cpp
To have better support for themed and custom backgrounds for wxMSW wxComboCtrl, use...
[wxWidgets.git] / src / gtk / clipbrd.cpp
index 924f7c88c02fe18f89762dbba35717d56ac39c3d..f963bdd6ae25f64068100803667f565c6f3fb8cb 100644 (file)
@@ -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