Remove GTK on Wayland workaround
Instead update our GTK window as intended.
Change-Id: I9b2cba11591ecdf7e0ceef49da1f841f55b71f92
diff --git a/edgetpuvision/gstreamer.py b/edgetpuvision/gstreamer.py
index 6b16a66..d553b5c 100644
--- a/edgetpuvision/gstreamer.py
+++ b/edgetpuvision/gstreamer.py
@@ -306,13 +306,9 @@
bus.connect('message', on_bus_message, pipeline, loop)
if display is not Display.NONE:
- # Workaround for https://gitlab.gnome.org/GNOME/gtk/issues/844 in gtk3 < 3.24.
- widget_draws = 123
- def on_widget_draw(widget, cairo):
- nonlocal widget_draws
- if widget_draws:
- widget.queue_draw()
- widget_draws -= 1
+ # Needed to commit the wayland sub-surface.
+ def on_gl_draw(sink, context, sample, widget):
+ widget.queue_draw()
return False
# Needed to account for window chrome etc.
@@ -342,8 +338,8 @@
glsink = pipeline.get_by_name('glsink')
glsink.get_static_pad('sink').add_probe(Gst.PadProbeType.EVENT_UPSTREAM, on_event_probe)
+ glsink.connect('client-draw', on_gl_draw, drawing_area)
set_display_contexts(glsink, drawing_area)
- drawing_area.connect('draw', on_widget_draw)
drawing_area.connect('configure-event', on_widget_configure, glsink)
window.connect('delete-event', Gtk.main_quit)
window.show_all()