From: H.G.Muller Date: Mon, 22 Sep 2014 19:59:00 +0000 (+0200) Subject: Fix detection of screen size GTK X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=6936dd1a9a9d2fdee7c52397e6e7be801e3976b5 Fix detection of screen size GTK A gdk call that can get the screen without there first being a window mapped to it is used now. This fixes initial sizing of the board window on a cold start. --- diff --git a/gtk/xboard.c b/gtk/xboard.c index 40e41c8..ef1daa2 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -1028,7 +1028,8 @@ main (int argc, char **argv) } else { SizeDefaults *szd = sizeDefaults; if (*appData.boardSize == NULLCHAR) { - GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(mainwindow)); // TODO: this does not work, as no mainwindow yet +// GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(mainwindow)); // TODO: this does not work, as no mainwindow yet + GdkScreen *screen = gdk_screen_get_default(); guint screenwidth = gdk_screen_get_width(screen); guint screenheight = gdk_screen_get_height(screen); while (screenwidth < (szd->minScreenSize*BOARD_WIDTH + 4)/8 ||