[gtk/wip/matthiasc/popup5: 135/145] surface: Fix the fallback move-to-rect implementation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup5: 135/145] surface: Fix the fallback move-to-rect implementation
- Date: Sun, 26 May 2019 19:13:04 +0000 (UTC)
commit c3f199504b2447c98acfc6d78394e6ef7d10eba5
Author: Matthias Clasen <mclasen redhat com>
Date: Wed May 22 23:47:59 2019 +0000
surface: Fix the fallback move-to-rect implementation
On X11, the final and flipped rects were reporting
global coordinates. This was showing up as misplaced
popover beaks.
gdk/gdksurface.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 8c123ef4e3..6056953a97 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -271,6 +271,7 @@ gdk_surface_real_move_to_rect (GdkSurface *surface,
GdkRectangle final_rect;
gboolean flipped_x;
gboolean flipped_y;
+ int x, y;
/* This implementation only works for backends that
* can provide root coordinates via get_root_coords.
@@ -373,6 +374,12 @@ gdk_surface_real_move_to_rect (GdkSurface *surface,
else
gdk_surface_move (surface, final_rect.x, final_rect.y);
+ gdk_surface_get_origin (toplevel, &x, &y);
+ final_rect.x -= x;
+ final_rect.y -= y;
+ flipped_rect.x -= x;
+ flipped_rect.y -= y;
+
g_signal_emit_by_name (surface,
"moved-to-rect",
&flipped_rect,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]