]> git.sesse.net Git - vlc/commitdiff
xcb_window: implement VOUT_SET_SIZE
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Thu, 9 Apr 2009 09:46:45 +0000 (12:46 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 9 Apr 2009 14:59:19 +0000 (17:59 +0300)
modules/video_output/xcb/window.c

index 6271316cb7ee16d525a0e6a0059bb1bdb22d95f9..9b72f42c0152a7092f58d531837ca738278513ea 100644 (file)
@@ -197,11 +197,32 @@ static void *Thread (void *data)
     return NULL;
 }
 
+#include <vlc_vout.h>
 
 static int Control (vout_window_t *wnd, int cmd, va_list ap)
 {
-    msg_Err (wnd, "request %d not implemented", cmd);
-    (void)ap;
-    return VLC_EGENERIC;
+    vout_window_sys_t *p_sys = wnd->p_sys;
+    xcb_connection_t *conn = p_sys->conn;
+
+    switch (cmd)
+    {
+        case VOUT_SET_SIZE:
+        {
+            unsigned width = va_arg (ap, unsigned);
+            unsigned height = va_arg (ap, unsigned);
+            const uint32_t values[] = { width, height, };
+
+            xcb_configure_window (conn, wnd->handle.xid,
+                                  XCB_CONFIG_WINDOW_WIDTH |
+                                  XCB_CONFIG_WINDOW_HEIGHT, values);
+            xcb_flush (conn);
+            break;
+        }
+
+        default:
+            msg_Err (wnd, "request %d not implemented", cmd);
+            return VLC_EGENERIC;
+    }
+    return VLC_SUCCESS;
 }