diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-09-12 18:46:44 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2016-09-14 11:29:32 +0800 |
commit | c529d0a96e688099c01f0c3fc1b9361f7875f9c8 (patch) | |
tree | 5e9bc75af12b5df88c8de9fa0fdb83d7b2b82808 /gdk | |
parent | d792400d7c258b349c1dbaed0a12eee796a4b958 (diff) | |
download | gtk+-c529d0a96e688099c01f0c3fc1b9361f7875f9c8.tar.gz |
wayland: Move and resize popup after it was configured
A popup may have moved and resized when configured. Make sure every
layer knows about this and call gdk_window_move_resize() with the
configured dimension and position. This won't actually move the
window, but might resize it.
https://bugzilla.gnome.org/show_bug.cgi?id=771117
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 4c6f38d1c8..fa8dbe0e87 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1639,7 +1639,7 @@ translate_to_real_parent_window_geometry (GdkWindow *window, *y -= parent->shadow_top; } -static void +static GdkWindow * translate_from_real_parent_window_geometry (GdkWindow *window, gint *x, gint *y) @@ -1652,6 +1652,8 @@ translate_from_real_parent_window_geometry (GdkWindow *window, *x -= dx - parent->shadow_left; *y -= dy - parent->shadow_top; + + return parent; } static void @@ -1836,9 +1838,12 @@ calculate_moved_to_rect_result (GdkWindow *window, gboolean *flipped_y) { GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkWindow *parent; + gint window_x, window_y; + gint window_width, window_height; GdkRectangle best_rect; - translate_from_real_parent_window_geometry (window, &x, &y); + parent = translate_from_real_parent_window_geometry (window, &x, &y); *final_rect = (GdkRectangle) { .x = x, .y = y, @@ -1846,6 +1851,15 @@ calculate_moved_to_rect_result (GdkWindow *window, .height = height, }; + window_x = parent->x + x; + window_y = parent->y + y; + window_width = width + window->shadow_left + window->shadow_right; + window_height = height + window->shadow_top + window->shadow_bottom; + + gdk_window_move_resize (window, + window_x, window_y, + window_width, window_height); + calculate_popup_rect (window, impl->pending_move_to_rect.rect_anchor, impl->pending_move_to_rect.window_anchor, |