From 9428376c613e7dfba6541df413d31d1df1ad0a9a Mon Sep 17 00:00:00 2001 From: Johns Date: Sat, 21 Jul 2012 15:07:48 +0200 Subject: Guard poll. Map only video window. --- video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/video.c b/video.c index 238d75f..f436849 100644 --- a/video.c +++ b/video.c @@ -148,8 +148,6 @@ static xcb_window_t VideoCreateWindow(xcb_window_t parent, xcb_configure_window(Connection, window, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values); - xcb_map_window(Connection, window); - return window; } @@ -467,6 +465,11 @@ void VideoPollEvents(int timeout) int n; int delay; + if (!Connection) { + Debug(3, "play: poll without connection\n"); + return; + } + fds[0].fd = xcb_get_file_descriptor(Connection); fds[0].events = POLLIN | POLLPRI; @@ -633,6 +636,7 @@ int VideoInit(const char *display) VideoPlayWindow = VideoCreateWindow(VideoScreen->root, VideoScreen->root_visual, VideoScreen->root_depth); + xcb_map_window(Connection, VideoPlayWindow); VideoOsdWindow = VideoCreateWindow(VideoPlayWindow, VideoScreen->root_visual, VideoScreen->root_depth); -- cgit v1.2.3