Freeze if a 16 bit per color image is set for GtkImage
When setting a certain image at runtime for a GtkImage, the whole application freezes.
Here's some code to reproduce the issue:
import gi
gi.require_version('Gtk', '4.0')
from gi.repository import GLib, Gtk
class App(Gtk.Application):
def do_activate(self):
self.win = Gtk.ApplicationWindow()
self.image = Gtk.Image()
self.win.set_child(self.image)
self.add_window(self.win)
self.win.present()
GLib.timeout_add(
1000, lambda: self.image.set_from_file('./gol_logo.png')
)
application = App()
application.run()
For the bug to be reproduced, the window needs to be visible, hence the timeout_add
.
This problem only occurs in a Wayland session. It cannot be reproduced in a Xorg session, or when setting GSK_RENDERER=cairo
.
The most peculiar thing is that this only happens with the gol_logo.png
image (attached to this issue as a tarball), but not with other images. I'm also attaching another image that I made (testimg.png
) that doesn't cause this issue, just as a counter-example.
CC: @msandova
Edited by Gabriele Musco