diff mbox

[3/8] sdl2: add display notify change support

Message ID 1386648358-25892-4-git-send-email-airlied@gmail.com
State New
Headers show

Commit Message

Dave Airlie Dec. 10, 2013, 4:05 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

this adds support for the callbacks from the console layer, when the gpu
changes the layouts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 ui/sdl2.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 2eb3e9c..dd8cd2b 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -880,6 +880,15 @@  static void sdl_mouse_define(DisplayChangeListener *dcl,
         SDL_SetCursor(guest_sprite);
 }
 
+static void sdl_notify_state(DisplayChangeListener *dcl,
+                             int x, int y, uint32_t width, uint32_t height)
+{
+    struct sdl2_console_state *scon = container_of(dcl, struct sdl2_console_state, dcl);
+
+    scon->x = x;
+    scon->y = y;
+}
+
 static void sdl_cleanup(void)
 {
     if (guest_sprite)
@@ -894,6 +903,7 @@  static const DisplayChangeListenerOps dcl_ops = {
     .dpy_refresh       = sdl_refresh,
     .dpy_mouse_set     = sdl_mouse_warp,
     .dpy_cursor_define = sdl_mouse_define,
+    .dpy_notify_state  = sdl_notify_state,
 };
 
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)