[gtk: 1/16] popover: Unrealize when autohide prop changes
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 1/16] popover: Unrealize when autohide prop changes
- Date: Wed, 19 Feb 2020 18:58:07 +0000 (UTC)
commit f43717a42e79eace619caa34e40b5e2d34f6cbb2
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Jul 24 15:45:34 2019 +0200
popover: Unrealize when autohide prop changes
Changing the autohide property means the popover needs to be remapped.
Remapping may need user interaction, so lets just unrealize the popover
if the property changes, forcing the application to remap it should it
be shown again.
gtk/gtkpopover.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index af1fee728b..b626a3fbd6 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1649,6 +1649,9 @@ gtk_popover_get_position (GtkPopover *popover)
* A modal popover will grab the keyboard focus on it when being
* displayed. Clicking outside the popover area or pressing Esc will
* dismiss the popover.
+ *
+ * Called this function on an already showing popup with a new autohide value
+ * different from the current one, will cause the popup to be hidden.
**/
void
gtk_popover_set_autohide (GtkPopover *popover,
@@ -1665,6 +1668,8 @@ gtk_popover_set_autohide (GtkPopover *popover,
priv->autohide = autohide;
+ gtk_widget_unrealize (GTK_WIDGET (popover));
+
g_object_notify_by_pspec (G_OBJECT (popover), properties[PROP_AUTOHIDE]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]