diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-31 14:42:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-31 14:42:26 +0400 |
commit | 73f301c3a8a28dd25ea850a54d968fc6c4f2b83e (patch) | |
tree | d8f26b84286c7468aa3d1cc71b929e890fb59a2e /source/blender/windowmanager | |
parent | 4d2efa877e305fc29121030120b7c53ae57950c4 (diff) |
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().
Diffstat (limited to 'source/blender/windowmanager')
-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); |