diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_window.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 83eadf6e833..a5f30fc5c62 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -114,6 +114,17 @@ void wm_get_screensize(int *width_r, int *height_r) *height_r = uiheight; } +/* size of all screens, useful since the mouse is bound by this */ +void wm_get_screensize_all(int *width_r, int *height_r) +{ + unsigned int uiwidth; + unsigned int uiheight; + + GHOST_GetAllDisplayDimensions(g_system, &uiwidth, &uiheight); + *width_r = uiwidth; + *height_r = uiheight; +} + /* keeps offset and size within monitor bounds */ /* XXX solve dual screen... */ static void wm_window_check_position(rcti *rect) @@ -829,7 +840,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr GHOST_DisposeRectangle(client_rect); - wm_get_screensize(&scr_w, &scr_h); + wm_get_screensize_all(&scr_w, &scr_h); sizex = r - l; sizey = b - t; posx = l; diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index ce360f5ef56..739ead27bdb 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -40,6 +40,7 @@ void wm_ghost_init (bContext *C); void wm_ghost_exit(void); void wm_get_screensize(int *width_r, int *height_r); +void wm_get_screensize_all(int *width_r, int *height_r); wmWindow *wm_window_new (bContext *C); void wm_window_free (bContext *C, wmWindowManager *wm, wmWindow *win); |