change defaults for window state on X11 (yet again), after further discussion.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 12 Mar 2013 14:55:52 +0000 (14:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 12 Mar 2013 14:55:52 +0000 (14:55 +0000)
instead use a fixed size as a default, clamp by the desktop size and add some padding (to account for title bar and panel).

source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_window.h

index b806cdc..53698ca 100644 (file)
@@ -444,11 +444,15 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
 #endif
 
 #if !defined(__APPLE__) && !defined(WIN32)  /* X11 */
-               /* X11, start maximized but use default same size */
+               /* X11, start maximized but use default sane size */
                wm_init_state.size_x = min_ii(wm_init_state.size_x, WM_WIN_INIT_SIZE_X);
                wm_init_state.size_y = min_ii(wm_init_state.size_y, WM_WIN_INIT_SIZE_Y);
+               /* pad */
+               wm_init_state.start_x = WM_WIN_INIT_PAD;
+               wm_init_state.start_y = WM_WIN_INIT_PAD;
+               wm_init_state.size_x -= WM_WIN_INIT_PAD * 2;
+               wm_init_state.size_y -= WM_WIN_INIT_PAD * 2;
 #endif
-
        }
        
        for (win = wm->windows.first; win; win = win->next) {
@@ -459,19 +463,7 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
                                win->sizex = wm_init_state.size_x;
                                win->sizey = wm_init_state.size_y;
 
-#if !defined(__APPLE__) && !defined(WIN32)  /* X11 */
-                               if (wm_init_state.override_flag & WIN_OVERRIDE_GEOM) {
-                                       /* we can't properly resize a maximized window */
-                                       win->windowstate = GHOST_kWindowStateNormal;
-                               }
-                               else {
-                                       /* loading without userpref, default to maximized */
-                                       win->windowstate = GHOST_kWindowStateMaximized;
-                               }
-#else
                                win->windowstate = GHOST_kWindowStateNormal;
-#endif
-
                                wm_init_state.override_flag &= ~WIN_OVERRIDE_GEOM;
                        }
 
index c4c64ed..a0546c8 100644 (file)
@@ -74,6 +74,7 @@ int                   wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op);
  * Clamped by real desktop limits */
 #define WM_WIN_INIT_SIZE_X 1800
 #define WM_WIN_INIT_SIZE_Y 1000
+#define WM_WIN_INIT_PAD 40
 
 #endif /* __WM_WINDOW_H__ */