[Spice-commits] 2 commits - src/spice-widget.c src/spice-widget-egl.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 9 11:23:32 UTC 2021


 src/spice-widget-egl.c |    2 +-
 src/spice-widget.c     |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 223f93c1d955d6bed4a592e6109a68bcbc6339be
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jan 29 17:09:12 2021 +0400

    widget: notify about existing gl scanouts on registering channel
    
    Show the current GL scanout, if any already.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>

diff --git a/src/spice-widget.c b/src/spice-widget.c
index 36bceaf..b618b76 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -3385,6 +3385,10 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, SpiceDisplay *di
         spice_g_signal_connect_object(channel, "notify::gl-scanout",
                                       G_CALLBACK(spice_display_widget_gl_scanout),
                                       display, G_CONNECT_SWAPPED);
+
+        if (spice_display_channel_get_gl_scanout(d->display)) {
+            spice_display_widget_gl_scanout(display);
+        }
 #if HAVE_EGL
         spice_g_signal_connect_object(channel, "gl-draw",
                                       G_CALLBACK(gl_draw), display, G_CONNECT_SWAPPED);
commit 2e4e3b7ba2fb6941fcfe06ce7dab8c09f6b6c632
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jan 29 17:08:30 2021 +0400

    egl: don't call gl_make_current if context isn't ready
    
    This avoids a critical warning. The function will eventually be called again on realize.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>

diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index e31e322..b40bebf 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -431,7 +431,7 @@ void spice_egl_resize_display(SpiceDisplay *display, int w, int h)
     SpiceDisplayPrivate *d = display->priv;
     int prog;
 
-    if (!gl_make_current(display, NULL))
+    if (!d->egl.context_ready || !gl_make_current(display, NULL))
         return;
 
     glGetIntegerv(GL_CURRENT_PROGRAM, &prog);


More information about the Spice-commits mailing list