diff mbox series

[3/3] ui/gtk: gd_draw_event returns FALSE when no cairo surface is bound

Message ID 20210703002809.26753-3-dongwon.kim@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] ui/gtk-egl: un-tab and re-tab should destroy egl surface and context | expand

Commit Message

Dongwon Kim July 3, 2021, 12:28 a.m. UTC
gd_draw_event shouldn't try to repaint if surface does not exist
for the VC.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
 ui/gtk.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kasireddy, Vivek July 16, 2021, 9:55 p.m. UTC | #1
Reviewed-by: Vivek Kasireddy <vivek.kasireddy@intel.com>


> -----Original Message-----
> From: Qemu-devel <qemu-devel-bounces+vivek.kasireddy=intel.com@nongnu.org> On
> Behalf Of Dongwon Kim
> Sent: Friday, July 02, 2021 5:28 PM
> To: qemu-devel@nongnu.org
> Cc: Kim, Dongwon <dongwon.kim@intel.com>
> Subject: [PATCH 3/3] ui/gtk: gd_draw_event returns FALSE when no cairo surface is
> bound
> 
> gd_draw_event shouldn't try to repaint if surface does not exist
> for the VC.
> 
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
> ---
>  ui/gtk.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index bfb95f3b4b..0a38deedc7 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -756,6 +756,9 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr,
> void *opaque)
>      if (!vc->gfx.ds) {
>          return FALSE;
>      }
> +    if (!vc->gfx.surface) {
> +        return FALSE;
> +    }
> 
>      vc->gfx.dcl.update_interval =
>          gd_monitor_update_interval(vc->window ? vc->window : s->window);
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index bfb95f3b4b..0a38deedc7 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -756,6 +756,9 @@  static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
     if (!vc->gfx.ds) {
         return FALSE;
     }
+    if (!vc->gfx.surface) {
+        return FALSE;
+    }
 
     vc->gfx.dcl.update_interval =
         gd_monitor_update_interval(vc->window ? vc->window : s->window);