]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/gtkutil/clipboard.cpp
Fix MSYS2 issues
[xonotic/netradiant.git] / libs / gtkutil / clipboard.cpp
index c8073aba478bf6922a77be881b769c4461544de9..2914875332eacc49cedae042efbe8e0f7a8f990a 100644 (file)
@@ -83,7 +83,7 @@ void clipboard_paste( ClipboardPasteFunc paste ){
 
 #else
 
-#include <gtk/gtkclipboard.h>
+#include <gtk/gtk.h>
 
 enum
 {
@@ -111,11 +111,11 @@ static void clipboard_clear( GtkClipboard *clipboard, gpointer data ){
 }
 
 static void clipboard_received( GtkClipboard *clipboard, GtkSelectionData *data, gpointer user_data ){
-       if ( data->length < 0 ) {
+       if ( gtk_selection_data_get_length(data) < 0 ) {
                globalErrorStream() << "Error retrieving selection\n";
        }
-       else if ( strcmp( gdk_atom_name( data->type ), clipboard_targets[0].target ) == 0 ) {
-               BufferInputStream istream( reinterpret_cast<const char*>( data->data ), data->length );
+       else if ( strcmp( gdk_atom_name( gtk_selection_data_get_data_type(data) ), clipboard_targets[0].target ) == 0 ) {
+               BufferInputStream istream( reinterpret_cast<const char*>( gtk_selection_data_get_data(data) ), gtk_selection_data_get_length(data) );
                ( *reinterpret_cast<ClipboardPasteFunc*>( user_data ) )( istream );
        }
 }