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

XCB window: avoid matchbox hack if matchbox is not running

Then we don't need to process all root window property events.
parent fd23a5c3
...@@ -192,7 +192,9 @@ static void CacheAtoms (vout_window_sys_t *p_sys) ...@@ -192,7 +192,9 @@ static void CacheAtoms (vout_window_sys_t *p_sys)
wm_state_fs_ck = intern_string (conn, "_NET_WM_STATE_FULLSCREEN"); wm_state_fs_ck = intern_string (conn, "_NET_WM_STATE_FULLSCREEN");
#ifdef MATCHBOX_HACK #ifdef MATCHBOX_HACK
xcb_intern_atom_cookie_t mb_current_app_window; xcb_intern_atom_cookie_t mb_current_app_window;
mb_current_app_window = intern_string (conn, "_MB_CURRENT_APP_WINDOW"); mb_current_app_window = xcb_intern_atom (conn, true,
strlen ("_MB_CURRENT_APP_WINDOW"),
"_MB_CURRENT_APP_WINDOW");
#endif #endif
p_sys->wm_state = get_atom (conn, wm_state_ck); p_sys->wm_state = get_atom (conn, wm_state_ck);
...@@ -314,18 +316,20 @@ static int Open (vlc_object_t *obj) ...@@ -314,18 +316,20 @@ static int Open (vlc_object_t *obj)
xcb_atom_t wm_window_role = get_atom (conn, wm_window_role_ck); xcb_atom_t wm_window_role = get_atom (conn, wm_window_role_ck);
set_ascii_prop (conn, window, wm_window_role, "vlc-video"); set_ascii_prop (conn, window, wm_window_role, "vlc-video");
/* Cache any EWMH atom we may need later */
CacheAtoms (p_sys);
#ifdef MATCHBOX_HACK #ifdef MATCHBOX_HACK
if (p_sys->mb_current_app_window)
{
uint32_t value = XCB_EVENT_MASK_PROPERTY_CHANGE; uint32_t value = XCB_EVENT_MASK_PROPERTY_CHANGE;
xcb_change_window_attributes (conn, scr->root, xcb_change_window_attributes (conn, scr->root,
XCB_CW_EVENT_MASK, &value); XCB_CW_EVENT_MASK, &value);
}
#endif #endif
/* Make the window visible */ /* Make the window visible */
xcb_map_window (conn, window); xcb_map_window (conn, window);
/* Cache any EWMH atom we may need later */
CacheAtoms (p_sys);
/* 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. */
if ((p_sys->keys != NULL) if ((p_sys->keys != NULL)
...@@ -333,6 +337,7 @@ static int Open (vlc_object_t *obj) ...@@ -333,6 +337,7 @@ static int Open (vlc_object_t *obj)
DestroyKeyHandler (p_sys->keys); DestroyKeyHandler (p_sys->keys);
#ifdef MATCHBOX_HACK #ifdef MATCHBOX_HACK
if (p_sys->mb_current_app_window)
xcb_set_input_focus (p_sys->conn, XCB_INPUT_FOCUS_POINTER_ROOT, xcb_set_input_focus (p_sys->conn, XCB_INPUT_FOCUS_POINTER_ROOT,
wnd->handle.xid, XCB_CURRENT_TIME); wnd->handle.xid, XCB_CURRENT_TIME);
#endif #endif
...@@ -390,7 +395,8 @@ static void *Thread (void *data) ...@@ -390,7 +395,8 @@ static void *Thread (void *data)
if (ProcessKeyEvent (p_sys->keys, ev) == 0) if (ProcessKeyEvent (p_sys->keys, ev) == 0)
continue; continue;
#ifdef MATCHBOX_HACK #ifdef MATCHBOX_HACK
if ((ev->response_type & 0x7f) == XCB_PROPERTY_NOTIFY) if (p_sys->mb_current_app_window
&& (ev->response_type & 0x7f) == XCB_PROPERTY_NOTIFY)
{ {
const xcb_property_notify_event_t *pne = const xcb_property_notify_event_t *pne =
(xcb_property_notify_event_t *)ev; (xcb_property_notify_event_t *)ev;
......
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