mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 14:50:06 +00:00
surface: Make move-to-rect work for popups
Now that we store popup parents separately, the client-side move-to-rect implementation must use them.
This commit is contained in:
parent
9af6d7f733
commit
1fa2a8217f
@ -300,7 +300,7 @@ gdk_surface_real_move_to_rect (GdkSurface *surface,
|
|||||||
gint rect_anchor_dx,
|
gint rect_anchor_dx,
|
||||||
gint rect_anchor_dy)
|
gint rect_anchor_dy)
|
||||||
{
|
{
|
||||||
GdkSurface *transient_for_toplevel;
|
GdkSurface *toplevel;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkMonitor *monitor;
|
GdkMonitor *monitor;
|
||||||
GdkRectangle bounds;
|
GdkRectangle bounds;
|
||||||
@ -310,14 +310,16 @@ gdk_surface_real_move_to_rect (GdkSurface *surface,
|
|||||||
gboolean flipped_x;
|
gboolean flipped_x;
|
||||||
gboolean flipped_y;
|
gboolean flipped_y;
|
||||||
|
|
||||||
/*
|
/* This implementation only works for backends that
|
||||||
* First translate the anchor rect to toplevel coordinates.
|
* can provide root coordinates via get_root_coords.
|
||||||
* This is needed because not all backends will be able to get
|
* Other backends need to implement move_to_rect.
|
||||||
* root coordinates for non-toplevel surfaces.
|
|
||||||
*/
|
*/
|
||||||
transient_for_toplevel = surface->transient_for;
|
if (surface->surface_type == GDK_SURFACE_POPUP)
|
||||||
|
toplevel = surface->parent;
|
||||||
|
else
|
||||||
|
toplevel = surface->transient_for;
|
||||||
|
|
||||||
gdk_surface_get_root_coords (transient_for_toplevel,
|
gdk_surface_get_root_coords (toplevel,
|
||||||
root_rect.x,
|
root_rect.x,
|
||||||
root_rect.y,
|
root_rect.y,
|
||||||
&root_rect.x,
|
&root_rect.x,
|
||||||
@ -2109,7 +2111,7 @@ gdk_surface_move_to_rect (GdkSurface *surface,
|
|||||||
gint rect_anchor_dy)
|
gint rect_anchor_dy)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||||
g_return_if_fail (surface->transient_for);
|
g_return_if_fail (surface->parent || surface->transient_for);
|
||||||
g_return_if_fail (rect);
|
g_return_if_fail (rect);
|
||||||
|
|
||||||
GDK_SURFACE_GET_CLASS (surface)->move_to_rect (surface,
|
GDK_SURFACE_GET_CLASS (surface)->move_to_rect (surface,
|
||||||
|
Loading…
Reference in New Issue
Block a user