[vlc-commits] xcb/window: implement --no-video-deco

Rémi Denis-Courmont git at videolan.org
Tue Jun 19 21:09:30 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 19 22:05:16 2018 +0300| [8b96fd4785569dc7ca5f6a271d900d94c974afa6] | committer: Rémi Denis-Courmont

xcb/window: implement --no-video-deco

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b96fd4785569dc7ca5f6a271d900d94c974afa6
---

 modules/video_output/xcb/window.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 793adb3eeb..3bf696309b 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -549,6 +549,19 @@ static void CacheAtoms (vout_window_sys_t *p_sys)
     p_sys->wm_state_fullscreen = get_atom (conn, wm_state_fs_ck);
 }
 
+static void set_wm_deco(xcb_connection_t *conn, xcb_window_t window, bool on)
+{
+    if (on)
+        return;
+
+    xcb_intern_atom_cookie_t atom_ck = intern_string(conn, "_MOTIF_WM_HINTS");
+    xcb_atom_t atom = get_atom(conn, atom_ck);
+    static const uint32_t motif_wm_hints[5] = { 2, 0, 0, 0, 0 };
+
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, window, atom,
+                        atom, 32, ARRAY_SIZE(motif_wm_hints), motif_wm_hints);
+}
+
 /**
  * Create an X11 window.
  */
@@ -645,6 +658,7 @@ static int Open (vout_window_t *wnd, const vout_window_cfg_t *cfg)
     xcb_change_property (conn, XCB_PROP_MODE_REPLACE, window, XA_WM_CLASS,
                          XA_STRING, 8, 8, "vlc\0Vlc");
     set_hostname_prop (conn, window);
+    set_wm_deco(conn, window, cfg->is_decorated);
 
     /* EWMH */
     xcb_intern_atom_cookie_t utf8_string_ck



More information about the vlc-commits mailing list