]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/clipbrd.cpp
compilation fix
[wxWidgets.git] / src / gtk / clipbrd.cpp
index a4bf7b6a6fbebecd5d955decd45f41440b985cba..f4ed88753f79f52160ed65ed00ac8a455a5dca75 100644 (file)
@@ -91,7 +91,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
 
     for (unsigned int i=0; i<selection_data->length/sizeof(GdkAtom); i++)
     {
-/*      char *name = gdk_atom_name (atoms[i]);
+/*        char *name = gdk_atom_name (atoms[i]);
         if (name) printf( "Format available: %s.\n", name ); */
       
         if (atoms[i] == clipboard->m_targetRequested)
@@ -370,6 +370,8 @@ wxClipboard::wxClipboard()
   
     m_formatSupported = FALSE;
     m_targetRequested = 0;
+    
+    m_usePrimary = FALSE;
 }
 
 wxClipboard::~wxClipboard()
@@ -422,7 +424,7 @@ bool wxClipboard::Open()
     wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
   
     m_open = TRUE;
-  
+    
     return TRUE;
 }
 
@@ -492,7 +494,6 @@ bool wxClipboard::AddData( wxDataObject *data )
                               (gpointer) NULL );
 #endif
 
-//    printf( "vorher.\n" );                          
     /* Tell the world we offer clipboard data */
     if (!gtk_selection_owner_set( m_clipboardWidget, 
                                   g_clipboardAtom,
@@ -502,10 +503,6 @@ bool wxClipboard::AddData( wxDataObject *data )
     }
     m_ownsClipboard = TRUE;
     
-//    printf( "nachher.\n" );                         
-    
-    return TRUE;
-    
     if (!gtk_selection_owner_set( m_clipboardWidget, 
                                   GDK_SELECTION_PRIMARY,
                                  GDK_CURRENT_TIME ))
@@ -547,7 +544,7 @@ bool wxClipboard::IsSupported( wxDataFormat format )
     m_waiting = TRUE;
 
     gtk_selection_convert( m_targetsWidget,
-                          g_clipboardAtom, 
+                          m_usePrimary?GDK_SELECTION_PRIMARY:g_clipboardAtom, 
                           g_targetsAtom,
                           GDK_CURRENT_TIME );
 
@@ -592,7 +589,7 @@ bool wxClipboard::GetData( wxDataObject *data )
     m_waiting = TRUE;
 
     gtk_selection_convert( m_clipboardWidget,
-                          g_clipboardAtom, 
+                          m_usePrimary?GDK_SELECTION_PRIMARY:g_clipboardAtom, 
                           m_targetRequested,
                           GDK_CURRENT_TIME );