GDK-Win32: Fix AeroSnap on HiDPI

Commit 1d0fad3 revealed that there were some assumptions made that were
actually to compensate for the bug fixed by that commit, so we need to
remove those assumptions as they would result in AerSnap to not work
properly on HiDPI screens.

Also re-do how we set the x and y positions of our GdkWindow, so that we
are more consistent across the board when we go between a GDK window
coordinate and a Windows API window cooredinate.

This would also simplify the code a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=785999
This commit is contained in:
Chun-wei Fan
2017-08-08 22:19:45 +08:00
parent 136f43e329
commit ebadaaa3e0
2 changed files with 70 additions and 74 deletions

View File

@ -1599,8 +1599,8 @@ _gdk_win32_do_emit_configure_event (GdkWindow *window,
impl->unscaled_height = rect.bottom - rect.top;
window->width = (impl->unscaled_width + impl->window_scale - 1) / impl->window_scale;
window->height = (impl->unscaled_height + impl->window_scale - 1) / impl->window_scale;
window->x = rect.left;
window->y = rect.top;
window->x = rect.left / impl->window_scale;
window->y = rect.top / impl->window_scale;
_gdk_window_update_size (window);