Author: cazfi
Date: Tue Aug 16 08:04:19 2016
New Revision: 33611

URL: http://svn.gna.org/viewcvs/freeciv?rev=33611&view=rev
Log:
Do not adjust initial defaults depending on screen size when screen size on 
unknown.

See bug #24968

Modified:
    trunk/client/gui-gtk-3.0/gui_main.c
    trunk/client/gui-gtk-3.x/gui_main.c

Modified: trunk/client/gui-gtk-3.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/gui_main.c?rev=33611&r1=33610&r2=33611&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/gui_main.c (original)
+++ trunk/client/gui-gtk-3.0/gui_main.c Tue Aug 16 08:04:19 2016
@@ -2389,9 +2389,15 @@
 **************************************************************************/
 void adjust_default_options(void)
 {
-  if (screen_height() <= 480) {
-    /* Freeciv is practically unusable outside fullscreen mode in so
-     * small display */
-    GUI_GTK_OPTION(fullscreen) = TRUE;
-  }
-}
+  int scr_height = screen_height();
+
+  if (scr_height > 0) {
+    /* Adjust these options only if we do know the screen height. */
+  
+    if (scr_height <= 480) {
+      /* Freeciv is practically unusable outside fullscreen mode in so
+       * small display */
+      GUI_GTK_OPTION(fullscreen) = TRUE;
+    }
+  }
+}

Modified: trunk/client/gui-gtk-3.x/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/gui_main.c?rev=33611&r1=33610&r2=33611&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.x/gui_main.c (original)
+++ trunk/client/gui-gtk-3.x/gui_main.c Tue Aug 16 08:04:19 2016
@@ -2389,9 +2389,15 @@
 **************************************************************************/
 void adjust_default_options(void)
 {
-  if (screen_height() <= 480) {
-    /* Freeciv is practically unusable outside fullscreen mode in so
-     * small display */
-    GUI_GTK_OPTION(fullscreen) = TRUE;
-  }
-}
+  int scr_height = screen_height();
+
+  if (scr_height > 0) {
+    /* Adjust these options only if we do know the screen height. */
+  
+    if (scr_height <= 480) {
+      /* Freeciv is practically unusable outside fullscreen mode in so
+       * small display */
+      GUI_GTK_OPTION(fullscreen) = TRUE;
+    }
+  }
+}


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to