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



commit 90c75f13ec61feb0d474d0d752d15ccd0442c5b6
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 85c280c484..9b7d952e36 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1615,6 +1615,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);
 }
 
 /**
@@ -1684,6 +1687,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]