[gtk/wip/carlosg/text-handle-natives: 370/372] gtkpopover: Re-present surface if position/pointing-to change while visible



commit e870df202d75f766b2d7580886b529850ebd42d6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Feb 27 18:08:46 2020 +0100

    gtkpopover: Re-present surface if position/pointing-to change while visible
    
    This ensures the popover will follow the new position parameters. This is
    necessary for popovers like the text magnifier that can be repositioned
    while visible.

 gtk/gtkpopover.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index c6e2d70e0d..088759f45c 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1657,6 +1657,9 @@ gtk_popover_set_pointing_to (GtkPopover         *popover,
     priv->has_pointing_to = FALSE;
 
   g_object_notify_by_pspec (G_OBJECT (popover), properties[PROP_POINTING_TO]);
+
+  if (gtk_widget_is_visible (GTK_WIDGET (popover)))
+    present_popup (popover);
 }
 
 /**
@@ -1726,6 +1729,9 @@ gtk_popover_set_position (GtkPopover      *popover,
   priv->final_position = position;
 
   g_object_notify_by_pspec (G_OBJECT (popover), properties[PROP_POSITION]);
+
+  if (gtk_widget_is_visible (GTK_WIDGET (popover)))
+    present_popup (popover);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]