diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-08-04 02:05:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-08-04 02:11:09 +0300 |
commit | 42f6252f2d3d08f07d395f581c9acc419c670c19 (patch) | |
tree | f39c40bfac2216462116d0224637325b212463f4 /source | |
parent | 7830ec54186e8b05a366775e02c6457eb83814a3 (diff) |
Fix T47782: popups with wrong size when switching from retina to non-retina on OS X.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b68b607f48b..425287993d9 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -69,6 +69,8 @@ #include "ED_screen.h" #include "ED_fileselect.h" +#include "UI_interface.h" + #include "PIL_time.h" #include "GPU_draw.h" @@ -1194,11 +1196,19 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr break; } case GHOST_kEventNativeResolutionChange: + { // printf("change, pixel size %f\n", GHOST_GetNativePixelSize(win->ghostwin)); U.pixelsize = wm_window_pixelsize(win); BKE_blender_userdef_refresh(); + // close all popups since they are positioned with the pixel + // size baked in and it's difficult to correct them + wmWindow *oldWindow = CTX_wm_window(C); + CTX_wm_window_set(C, win); + UI_popup_handlers_remove_all(C, &win->modalhandlers); + CTX_wm_window_set(C, oldWindow); + wm_window_make_drawable(wm, win); wm_draw_window_clear(win); @@ -1206,6 +1216,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, NULL); break; + } case GHOST_kEventTrackpad: { GHOST_TEventTrackpadData *pd = data; |