From 73f301c3a8a28dd25ea850a54d968fc6c4f2b83e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Jan 2013 10:42:26 +0000 Subject: add ghost function getAllDisplayDimensions, GHOST_GetAllDisplayDimensions This returns the desktop size, not just the size of the active monitor, useful since this constrains the mouse and we dont have to detect the active monitor (which isn't so straightforward with xlib). carbon/cocoa are TODO, they still use getMainDisplayDimensions(). --- source/blender/windowmanager/intern/wm_window.c | 13 ++++++++++++- source/blender/windowmanager/wm_window.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender') 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); -- cgit v1.2.3