[Spice-devel] [PATCH spice-gtk 3/5] widget: skip spice_egl_resize_display() if context is not ready

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Wed Jun 7 20:55:39 UTC 2017


From: Marc-André Lureau <marcandre.lureau at redhat.com>

And call spice_egl_resize_display() when initializing the context.

This fixes the "Couldn't find current GL or GLX context" error for me
on X11. I thought first it was somehow related to commit a395ac59447de
"spice-widget: init egl only after first gl_scanout", but reverting it
didn't solve the problem, there are other timing changes, probably at
gtk level.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/spice-widget.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/spice-widget.c b/src/spice-widget.c
index d948c6d..319d867 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1329,7 +1329,7 @@ static void set_egl_enabled(SpiceDisplay *display, bool enabled)
                                          enabled ? "gl-area" : "draw-area");
     }
 
-    if (enabled) {
+    if (enabled && d->egl.context_ready) {
         spice_egl_resize_display(display, d->ww, d->wh);
     }
 
@@ -2863,6 +2863,8 @@ void spice_display_widget_gl_scanout(SpiceDisplay *display)
             g_critical("egl realize failed: %s", err->message);
             g_clear_error(&err);
         }
+
+        spice_egl_resize_display(display, d->ww, d->wh);
     }
 #endif
 
-- 
2.13.0.91.g00982b8dd



More information about the Spice-devel mailing list