qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 1/2] sdl2: add ui info setting.


From: Gerd Hoffmann
Subject: [Qemu-devel] [PULL 1/2] sdl2: add ui info setting.
Date: Tue, 29 Apr 2014 12:18:51 +0200

From: Dave Airlie <address@hidden>

Allows you to resize the sdl2 window and have the guest notice.

[ kraxel: zero-initialize QemuUIInfo ]

Signed-off-by: Dave Airlie <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
 ui/sdl2.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 7506e2e..94d6d3f 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -612,6 +612,13 @@ static void handle_windowevent(DisplayChangeListener *dcl, 
SDL_Event *ev)
     switch (ev->window.event) {
     case SDL_WINDOWEVENT_RESIZED:
         sdl_scale(scon, ev->window.data1, ev->window.data2);
+        {
+            QemuUIInfo info;
+            memset(&info, 0, sizeof(info));
+            info.width = ev->window.data1;
+            info.height = ev->window.data2;
+            dpy_set_ui_info(scon->dcl.con, &info);
+        }
         graphic_hw_invalidate(scon->dcl.con);
         graphic_hw_update(scon->dcl.con);
         break;
-- 
1.8.3.1




reply via email to

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