Re: [gtk-osx-users] Pasting images from clipboard




On Feb 15, 2016, at 11:12 AM, Miroslav Rajcic <mrajcic hotmail com> wrote:

The test is exactly the same, I just forgot to remove Windows-specific files (Visual Studio project) when 
re-uploading the code.
I use modulesets-stable version of GTK+.


I haven't yet made a patch for gtk-osx, I expected you to go test with a git clone. The change is below: 
Apply it and try again.

Regards,
John Ralls


diff --git a/gtk/gtkclipboard-quartz.c b/gtk/gtkclipboard-quartz.c
index 29c7b11..79a3fd5 100644
--- a/gtk/gtkclipboard-quartz.c
+++ b/gtk/gtkclipboard-quartz.c
@@ -754,23 +754,18 @@ gtk_clipboard_wait_for_text (GtkClipboard *clipboard)
GdkPixbuf *
gtk_clipboard_wait_for_image (GtkClipboard *clipboard)
{
- const gchar *priority[] = { "image/png", "image/tiff", "image/jpeg", "image/gif", "image/bmp" };
+ GdkAtom target = gdk_atom_intern_static_string("image/tiff")
int i;
GtkSelectionData *data;
- for (i = 0; i < G_N_ELEMENTS (priority); i++)
- {
- data = gtk_clipboard_wait_for_contents (clipboard, gdk_atom_intern_static_string (priority[i]));
-
- if (data)
-       {
-       GdkPixbuf *pixbuf = gtk_selection_data_get_pixbuf (data);
-
-       gtk_selection_data_free (data);
+ data = gtk_clipboard_wait_for_contents (clipboard, target);
-       return pixbuf;
-       }
- }
+ if (data && data->data)
+ {
+ GdkPixbuf *pixbuf = gtk_selection_data_get_pixbuf (data);
+ gtk_selection_data_free (data);
+ return pixbuf;
+ }
return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]