Commit 051d673d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

xcb_window: implement fullscreen mode

parent f246d924
...@@ -75,7 +75,7 @@ struct vout_window_sys_t ...@@ -75,7 +75,7 @@ struct vout_window_sys_t
xcb_window_t root; xcb_window_t root;
xcb_atom_t wm_state; xcb_atom_t wm_state;
xcb_atom_t wm_state_above; xcb_atom_t wm_state_above;
/*xcb_atom_t wmstate_fullscreen;*/ xcb_atom_t wm_state_fullscreen;
}; };
/** Set an X window property from a nul-terminated string */ /** Set an X window property from a nul-terminated string */
...@@ -245,13 +245,15 @@ static int Open (vlc_object_t *obj) ...@@ -245,13 +245,15 @@ static int Open (vlc_object_t *obj)
set_string (conn, window, utf8, net_wm_icon_name, _("VLC")); set_string (conn, window, utf8, net_wm_icon_name, _("VLC"));
/* Cache any EWMH atom we may need later */ /* Cache any EWMH atom we may need later */
xcb_intern_atom_cookie_t wm_state_ck, wm_state_above_ck; xcb_intern_atom_cookie_t wm_state_ck, wm_state_above_ck, wm_state_fs_ck;
wm_state_ck = intern_string (conn, "_NET_WM_STATE"); wm_state_ck = intern_string (conn, "_NET_WM_STATE");
wm_state_above_ck = intern_string (conn, "_NET_WM_STATE_ABOVE"); wm_state_above_ck = intern_string (conn, "_NET_WM_STATE_ABOVE");
wm_state_fs_ck = intern_string (conn, "_NET_WM_STATE_FULLSCREEN");
p_sys->wm_state = get_atom (conn, wm_state_ck); p_sys->wm_state = get_atom (conn, wm_state_ck);
p_sys->wm_state_above = get_atom (conn, wm_state_above_ck); p_sys->wm_state_above = get_atom (conn, wm_state_above_ck);
p_sys->wm_state_fullscreen = get_atom (conn, wm_state_fs_ck);
/* Create the event thread. It will dequeue all events, so any checked /* Create the event thread. It will dequeue all events, so any checked
* request from this thread must be completed at this point. */ * request from this thread must be completed at this point. */
...@@ -373,23 +375,22 @@ static int Control (vout_window_t *wnd, int cmd, va_list ap) ...@@ -373,23 +375,22 @@ static int Control (vout_window_t *wnd, int cmd, va_list ap)
xcb_configure_window (conn, wnd->handle.xid, xcb_configure_window (conn, wnd->handle.xid,
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_WIDTH |
XCB_CONFIG_WINDOW_HEIGHT, values); XCB_CONFIG_WINDOW_HEIGHT, values);
xcb_flush (conn);
break; break;
} }
case VOUT_WINDOW_SET_ON_TOP: case VOUT_WINDOW_SET_ON_TOP:
{ set_wm_state (wnd, va_arg (ap, int), p_sys->wm_state_above);
bool on = va_arg (ap, int); break;
set_wm_state (wnd, on, p_sys->wm_state_above); case VOUT_WINDOW_SET_FULLSCREEN:
xcb_flush (p_sys->conn); set_wm_state (wnd, va_arg (ap, int), p_sys->wm_state_fullscreen);
return VLC_SUCCESS; break;
}
default: default:
msg_Err (wnd, "request %d not implemented", cmd); msg_Err (wnd, "request %d not implemented", cmd);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
xcb_flush (p_sys->conn);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment