[Bf-blender-cvs] [b3216ecd68e] temp-benchmark: Benchmark: center window in screen instead of bottom left.
Brecht Van Lommel
noreply at git.blender.org
Tue Aug 7 15:47:27 CEST 2018
Commit: b3216ecd68eed8ef565ba12822fcd8ac8b29b13b
Author: Brecht Van Lommel
Date: Tue Aug 7 15:30:03 2018 +0200
Branches: temp-benchmark
https://developer.blender.org/rBb3216ecd68eed8ef565ba12822fcd8ac8b29b13b
Benchmark: center window in screen instead of bottom left.
===================================================================
M source/blender/windowmanager/intern/wm_window.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 2156c19ae2e..b86026623c0 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -777,11 +777,16 @@ void wm_window_ghostwindows_ensure(wmWindowManager *wm)
win->cursor = CURSOR_STD;
}
- /* Benchmark: fixed size window. */
+ /* Benchmark: fixed size and centered window. */
wm_window_set_startup_dpi(win);
win->sizex = 800 * UI_DPI_FAC;
win->sizey = 570 * UI_DPI_FAC;
+ int scr_w, scr_h;
+ wm_get_screensize(&scr_w, &scr_h);
+ win->posx = (scr_w - win->sizex) / 2;
+ win->posy = (scr_h - win->sizey) / 2;
+
/* Benchmark: title. */
wm_window_ghostwindow_add(wm, "Blender Benchmark", win);
}
More information about the Bf-blender-cvs
mailing list