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>
This commit is contained in:
Dave Airlie 2014-03-25 16:50:36 +10:00 committed by Gerd Hoffmann
parent e2da502c00
commit 8b15d9f1d2

View File

@ -612,6 +612,13 @@ static void handle_windowevent(DisplayChangeListener *dcl, SDL_Event *ev)
switch (ev->window.event) { switch (ev->window.event) {
case SDL_WINDOWEVENT_RESIZED: case SDL_WINDOWEVENT_RESIZED:
sdl_scale(scon, ev->window.data1, ev->window.data2); 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_invalidate(scon->dcl.con);
graphic_hw_update(scon->dcl.con); graphic_hw_update(scon->dcl.con);
break; break;