qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] sdl2: Check if window exists before updating it


From: Antonio Caggiano
Subject: Re: [PATCH] sdl2: Check if window exists before updating it
Date: Fri, 9 Jun 2023 10:08:56 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2

Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>

On 08/06/2023 16:55, Akihiko Odaki wrote:
A console does not have a window if the surface is a placeholder and
the console is not the first one. sdl2 cannot update the texture in
such a case.

Add a proper check for window existence. Such a check is only necessary
for the "gl" implementation as the "2d" implementation checks for the
texture, which is set only if a window exists.

Fixes: c821a58ee7 ("ui/console: Pass placeholder surface to displays")
Reported-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
  ui/sdl2-gl.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 39cab8cde7..bbfa70eac3 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -67,6 +67,10 @@ void sdl2_gl_update(DisplayChangeListener *dcl,
assert(scon->opengl); + if (!scon->real_window) {
+        return;
+    }
+
      SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
      surface_gl_update_texture(scon->gls, scon->surface, x, y, w, h);
      scon->updates++;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]