Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-01-31 09:37:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-31 09:37:52 +0400
commit29456505f3749dd00fc53351faef0306836361f3 (patch)
tree01bb1822e25e6c19f3a3605b8c1a74297fa65f77 /source/blender/windowmanager
parentd7623c0e161297a66c44bf54e38a0db4c2d59942 (diff)
fix/workaround [#34026] Blender starts with too large window
Minimal change to stop blender window opening across all monitors. Workaround the problem by starting maximized, and using sane defaults for non maximized window. I checked on a few different solutions to this, Using Xinerama works OK, but with different size monitors and not knowing which one the window-manager will pick in advance - this can be wrong too. Now instead of opening with the screen size, just start maximized and use a default size for the non-maximized window (clamped by the screen size). This isn't perfect since you could have 2x monitors at 1024x768, open blender, un-maximize - and blender window would cross over into the second monitor.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 44c5693c3e3..bd6342ebc25 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -425,6 +425,15 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
wm_set_apple_prefsize(wm_init_state.size_x, wm_init_state.size_y);
}
#else
+ /* default size when un-maximized, unless the screen(s) are smaller */
+
+ /* clamp by these arbitrary values because currently wm_get_screensize()
+ * will span multiple monitors and using xinerama isnt totally reliable
+ * since we don't which monitor the window manager will put the blender
+ * window in. */
+ wm_init_state.size_x = MIN2(1800, wm_init_state.size_x - 100);
+ wm_init_state.size_y = MIN2(980, wm_init_state.size_y - 100);
+
wm_init_state.start_x = 0;
wm_init_state.start_y = 0;
@@ -439,8 +448,14 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
win->sizex = wm_init_state.size_x;
win->sizey = wm_init_state.size_y;
- /* we can't properly resize a maximized window */
- win->windowstate = GHOST_kWindowStateNormal;
+ if (wm_init_state.override_flag & WIN_OVERRIDE_GEOM) {
+ /* we can't properly resize a maximized window */
+ win->windowstate = GHOST_kWindowStateNormal;
+ }
+ else {
+ /* otherwise default factory settings start maximized */
+ win->windowstate = GHOST_kWindowStateMaximized;
+ }
wm_init_state.override_flag &= ~WIN_OVERRIDE_GEOM;
}