[gtk/wip.win32.fixes: 249/255] GDK-Win32: Fix AeroSnap indicator and positioning
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip.win32.fixes: 249/255] GDK-Win32: Fix AeroSnap indicator and positioning
- Date: Mon, 4 Oct 2021 10:15:03 +0000 (UTC)
commit 183d770fa8a32f6012224beeb4a38b8803cec61d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Jul 6 17:15:39 2021 +0800
GDK-Win32: Fix AeroSnap indicator and positioning
Ensure that we take the DPI scaling into account so that surfaces will
be placed at their correct positions upon an AeroSnap operation on HiDPI
displays.
Also, use the X coordinate of the surface as-is during snap up so that
we do not inadvertently move the surface to the very left. Also fix the
AeroSnap indicator drawing for snap up so that it is drawn at the
correct places.
gdk/win32/gdksurface-win32.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 5514215e6d..6431638137 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -2326,19 +2326,11 @@ snap_up (GdkSurface *window)
y = 0;
height = maxysize;
- x = x - impl->shadow.left;
- y = y - impl->shadow.top;
+ x = surface->x - impl->shadow.left / impl->surface_scale;
+ y = y - impl->shadow.top / impl->surface_scale;
width += impl->shadow_x;
height += impl->shadow_y;
- /* XXX: FIXME, AeroSnap snap_up() not really working well,
- *
- * * The snap_up() puts the window at the top left corner.
- * * Without the following call, the height maximizes but we see a spew of
- * "GdkToplevelSize: geometry size (x,y) exceeds bounds" warnings
- */
- compute_toplevel_size (window, TRUE, &width, &height);
-
gdk_win32_surface_move_resize (window, x, y, width, height);
}
@@ -2360,8 +2352,8 @@ snap_left (GdkSurface *window,
rect.width = rect.width / 2;
- rect.x = rect.x - impl->shadow.left;
- rect.y = rect.y - impl->shadow.top;
+ rect.x = rect.x - impl->shadow.left / impl->surface_scale;
+ rect.y = rect.y - impl->shadow.top / impl->surface_scale;
rect.width = rect.width + impl->shadow_x;
rect.height = rect.height + impl->shadow_y;
@@ -2389,8 +2381,8 @@ snap_right (GdkSurface *window,
rect.width = rect.width / 2;
rect.x += rect.width;
- rect.x = rect.x - impl->shadow.left;
- rect.y = rect.y - impl->shadow.top;
+ rect.x = rect.x - impl->shadow.left / impl->surface_scale;
+ rect.y = rect.y - impl->shadow.top / impl->surface_scale;
rect.width = rect.width + impl->shadow_x;
rect.height = rect.height + impl->shadow_y;
@@ -3025,6 +3017,7 @@ update_fullup_indicator (GdkSurface *window,
to.height = gdk_surface_get_height (window);
to.y = 0;
+ to.x = window->x;
to.height = maxysize;
from = context->indicator_target;
@@ -3177,6 +3170,7 @@ start_indicator (GdkSurface *window,
end_size.height = workarea.height;
break;
case GDK_WIN32_AEROSNAP_STATE_FULLUP:
+ start_size.x = end_size.x = window->x;
end_size.y = 0;
end_size.height = maxysize;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]