From 6936dd1a9a9d2fdee7c52397e6e7be801e3976b5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 22 Sep 2014 21:59:00 +0200 Subject: [PATCH] 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. --- gtk/xboard.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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 || -- 1.7.0.4