Unable to paste images in windows Paint
When Paint tries to paste a clipboard image an error pop up is raised saying "The information from clipboard can't be inserted into paint"
Steps to reproduce
- Sets the contents of the clipboard:
- use gtk_target_list_add_image_targets to generate the list of image targets
- use gtk_clipboard_set_with_data to set the clipboard's content
- Open Paint
- Paste the image
- the callback is called
- the pixbuf is loaded and passed to the selection data
- An error is raised by Paint: "The information from clipboard can't be inserted into paint"
- A warning is logged by GDK: "Don't know how to transmute from target 0x0000000000000050 to format 0x8"
A sample test code is attached to reproduce the issue. clipboard_tester.c
Current behavior
When Paint tries to paste a clipboard image an error pop up is raised saying
The information from clipboard can't be inserted into paint"
While in the logs we see
Gdk-WARNING **: 17:49:32.691: Don't know how to transmute from target 0x0000000000000050 to format 0x8
The error is raised after the upgrade of gtk libraries from version 3.20 to version 3.22.
According our investigation the target 0x0000000000000050 corresponds to image/png while the 0x8 is CF_DIB.
To set the clipboard content gtk_clipboard_set_with_data is used while the list of targets has been generated by gtk_target_list_add_image_targets. If we generate the list of targets with only the image/bmp target atom no error is raised and the image is pasted (see the attached code).
Expected outcome
We expect no difference between GTK 3.20 and 3.22, in both cases no error should be raised by Paint when we use gtk_target_list_add_image_targets.
Version information
We are building GTK 3.22 on windows with gvsbuild.
Additional information
Error raised by paint:
The information from clipboard can't be inserted into paint
Error logged by our software:
Gdk-WARNING **: 17:49:32.691: Don't know how to transmute from target 0x0000000000000050 to format 0x8