summaryrefslogtreecommitdiff
path: root/gtk/gtkpopover.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-06-09 09:17:43 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-06-09 13:31:06 -0400
commit8915e9cf42ea88c522ba2d17918b22986cd3a4d8 (patch)
tree64e912107be1a933bde91cbc87c84e0373f82dd4 /gtk/gtkpopover.c
parent22cc9749c93af989408eb3761f8ec6b8ab0869f2 (diff)
downloadgtk+-8915e9cf42ea88c522ba2d17918b22986cd3a4d8.tar.gz
GtkPopover: Use G_PARAM_EXPLICIT_NOTIFY
Diffstat (limited to 'gtk/gtkpopover.c')
-rw-r--r--gtk/gtkpopover.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 8a90868f44..089e8e948a 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -354,6 +354,9 @@ gtk_popover_apply_modality (GtkPopover *popover,
{
GtkPopoverPrivate *priv = popover->priv;
+ if (!priv->window)
+ return;
+
if (modal)
{
GtkWidget *prev_focus;
@@ -1308,7 +1311,7 @@ gtk_popover_class_init (GtkPopoverClass *klass)
P_("Position"),
P_("Position to place the bubble window"),
GTK_TYPE_POSITION_TYPE, GTK_POS_TOP,
- GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_EXPLICIT_NOTIFY));
/**
* GtkPopover:modal
@@ -1324,7 +1327,7 @@ gtk_popover_class_init (GtkPopoverClass *klass)
P_("Modal"),
P_("Whether the popover is modal"),
TRUE,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
signals[CLOSED] =
g_signal_new (I_("closed"),
@@ -1665,8 +1668,11 @@ static void
gtk_popover_update_preferred_position (GtkPopover *popover,
GtkPositionType position)
{
- popover->priv->preferred_position = position;
- g_object_notify (G_OBJECT (popover), "position");
+ if (popover->priv->preferred_position != position)
+ {
+ popover->priv->preferred_position = position;
+ g_object_notify (G_OBJECT (popover), "position");
+ }
}
/**