diff options
author | Jesse Y <deadpin> | 2021-01-12 14:00:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-01-13 14:12:36 +0300 |
commit | dc170a6d67826ee4201384f90065141ef4fae96e (patch) | |
tree | e223095778f2b584c487381658bd97a64e04e118 /source/blender/windowmanager | |
parent | 8964c02348f61c2ce8046c09478180ddfbd0f8e5 (diff) |
Fix: popout windows are sized incorrectly on high DPI screens
There should be a conversion to native pixel size as expected by GHOST at the
window manager level, the dimensions at screen level do not need a conversion.
Differential Revision: https://developer.blender.org/D9976
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 14798653a31..42fd214543f 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -801,10 +801,12 @@ wmWindow *WM_window_open(bContext *C, const rcti *rect) wmWindow *win_prev = CTX_wm_window(C); wmWindow *win = wm_window_new(CTX_data_main(C), wm, win_prev, false); - win->posx = rect->xmin; - win->posy = rect->ymin; - win->sizex = BLI_rcti_size_x(rect); - win->sizey = BLI_rcti_size_y(rect); + const float native_pixel_size = GHOST_GetNativePixelSize(win_prev->ghostwin); + + win->posx = rect->xmin / native_pixel_size; + win->posy = rect->ymin / native_pixel_size; + win->sizex = BLI_rcti_size_x(rect) / native_pixel_size; + win->sizey = BLI_rcti_size_y(rect) / native_pixel_size; WM_check(C); |