Window defaults to fullscreen without geometry.

This commit is contained in:
Johns 2012-02-13 14:00:53 +01:00
parent 33c638d538
commit f872f54e2a
2 changed files with 24 additions and 9 deletions

View File

@ -1,3 +1,9 @@
User johns
Date:
Release Version 0.4.7
Window size defaults to fullscreen, if no geometry is given.
User m.Rcu User m.Rcu
Date: Sun Feb 12 20:28:22 CET 2012 Date: Sun Feb 12 20:28:22 CET 2012

27
video.c
View File

@ -9162,21 +9162,21 @@ void VideoInit(const char *display_name)
} }
// Open the connection to the X server. // Open the connection to the X server.
// use the DISPLAY environment variable as the default display name // use the DISPLAY environment variable as the default display name
if (!display_name) { if (!display_name && !(display_name = getenv("DISPLAY"))) {
display_name = getenv("DISPLAY"); // if no environment variable, use :0.0 as default display name
if (!display_name) { display_name = ":0.0";
// use :0.0 as default display name
display_name = ":0.0";
}
} }
if (!(XlibDisplay = XOpenDisplay(display_name))) { if (!(XlibDisplay = XOpenDisplay(display_name))) {
Fatal(_("video: Can't connect to X11 server on '%s'\n"), display_name); Error(_("video: Can't connect to X11 server on '%s'\n"), display_name);
// FIXME: we need to retry connection // FIXME: we need to retry connection
return;
} }
// XInitThreads(); // XInitThreads();
// Convert XLIB display to XCB connection // Convert XLIB display to XCB connection
if (!(Connection = XGetXCBConnection(XlibDisplay))) { if (!(Connection = XGetXCBConnection(XlibDisplay))) {
Fatal(_("video: Can't convert XLIB display to XCB connection\n")); Error(_("video: Can't convert XLIB display to XCB connection\n"));
VideoExit();
return;
} }
// prefetch extensions // prefetch extensions
//xcb_prefetch_extension_data(Connection, &xcb_big_requests_id); //xcb_prefetch_extension_data(Connection, &xcb_big_requests_id);
@ -9201,8 +9201,10 @@ void VideoInit(const char *display_name)
if (!VideoWindowHeight) { if (!VideoWindowHeight) {
if (VideoWindowWidth) { if (VideoWindowWidth) {
VideoWindowHeight = (VideoWindowWidth * 9) / 16; VideoWindowHeight = (VideoWindowWidth * 9) / 16;
} else { // default to fullscreen
VideoWindowHeight = screen->height_in_pixels;
VideoWindowWidth = screen->width_in_pixels;
} }
VideoWindowHeight = 576;
} }
if (!VideoWindowWidth) { if (!VideoWindowWidth) {
VideoWindowWidth = (VideoWindowHeight * 16) / 9; VideoWindowWidth = (VideoWindowHeight * 16) / 9;
@ -9265,6 +9267,13 @@ void VideoInit(const char *display_name)
} }
//xcb_prefetch_maximum_request_length(Connection); //xcb_prefetch_maximum_request_length(Connection);
xcb_flush(Connection); xcb_flush(Connection);
// I would like to start threads here, but this produces:
// [xcb] Unknown sequence number while processing queue
// [xcb] Most likely this is a multi-threaded client and XInitThreads
// has not been called
//VideoPollEvent();
//VideoThreadInit();
} }
/// ///