summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-03-25 16:50:36 +1000
committerGerd Hoffmann <kraxel@redhat.com>2014-04-29 10:46:33 +0200
commit8b15d9f1d2954c405bbbf53968f0f5660f946311 (patch)
treed2a755f0d972ee5ed6ebf3d924adbcb243f0779d /ui
parente2da502c003b9a91b4aea7684959192bd07c1f1d (diff)
downloadqemu-8b15d9f1d2954c405bbbf53968f0f5660f946311.tar.gz
qemu-8b15d9f1d2954c405bbbf53968f0f5660f946311.tar.bz2
qemu-8b15d9f1d2954c405bbbf53968f0f5660f946311.zip
sdl2: add ui info setting.
Allows you to resize the sdl2 window and have the guest notice. [ kraxel: zero-initialize QemuUIInfo ] Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/sdl2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 7506e2e13f..94d6d3f887 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;