[PATCH v3 7/9] widget: update d->ready based on scanout image available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



d->ready is updated based on monitor area & canvas. In case of GL
rendering, update it based on monitor area & scanout and add check
before drawing update.

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxx>
Acked-by: Pavel Grunt <pgrunt@xxxxxxxxxx>
---
 src/spice-widget-egl.c | 6 ++----
 src/spice-widget.c     | 6 +++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index b9bec68..126269f 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -396,7 +396,7 @@ void spice_egl_resize_display(SpiceDisplay *display, int w, int h)
     apply_ortho(d->egl.mproj, 0, w, 0, h, -1, 1);
     glViewport(0, 0, w, h);
 
-    if (d->egl.image)
+    if (d->ready)
         spice_egl_update_display(display);
 
     glUseProgram(prog);
@@ -506,9 +506,7 @@ void spice_egl_update_display(SpiceDisplay *display)
     gdouble tx, ty, tw, th;
     int prog;
 
-    g_return_if_fail(d->egl.image != NULL);
-    if (d->egl.surface == EGL_NO_SURFACE)
-        return;
+    g_return_if_fail(d->ready);
 
     spice_display_get_scaling(display, &s, &x, &y, &w, &h);
 
diff --git a/src/spice-widget.c b/src/spice-widget.c
index b75bcd7..fdac085 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -232,7 +232,11 @@ static void update_ready(SpiceDisplay *display)
     SpiceDisplayPrivate *d = display->priv;
     gboolean ready;
 
-    ready = d->mark != 0 && d->monitor_ready;
+    ready = d->monitor_ready &&
+#ifndef G_OS_WIN32
+        d->egl.enabled ? d->egl.image != NULL :
+#endif
+        d->mark;
 
     /* If the 'resize-guest' property is set, the application expects spice-gtk
      * to manage the size and state of the displays, so update the 'enabled'
-- 
2.5.5

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]