entry: Avoid bubblewindow popup/popdown API

Besides setting all positioning properties at once, popup() would just
show the widget, so do that directly after just updating the position.
This commit is contained in:
Carlos Garnacho 2013-11-12 14:35:17 +01:00
parent 1813c8391c
commit 8384ef961e

View File

@ -9361,7 +9361,7 @@ activate_bubble_cb (GtkWidget *item,
{ {
const gchar *signal = g_object_get_data (G_OBJECT (item), "gtk-signal"); const gchar *signal = g_object_get_data (G_OBJECT (item), "gtk-signal");
g_signal_emit_by_name (entry, signal); g_signal_emit_by_name (entry, signal);
_gtk_bubble_window_popdown (GTK_BUBBLE_WINDOW (entry->priv->selection_bubble)); gtk_widget_hide (entry->priv->selection_bubble);
} }
static void static void
@ -9406,6 +9406,9 @@ bubble_targets_received (GtkClipboard *clipboard,
gtk_widget_destroy (priv->selection_bubble); gtk_widget_destroy (priv->selection_bubble);
priv->selection_bubble = _gtk_bubble_window_new (GTK_WIDGET (entry)); priv->selection_bubble = _gtk_bubble_window_new (GTK_WIDGET (entry));
_gtk_bubble_window_set_position (GTK_BUBBLE_WINDOW (priv->selection_bubble),
GTK_POS_TOP);
toolbar = GTK_WIDGET (gtk_toolbar_new ()); toolbar = GTK_WIDGET (gtk_toolbar_new ());
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_TEXT); gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_TEXT);
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
@ -9453,8 +9456,9 @@ bubble_targets_received (GtkClipboard *clipboard,
rect.width = 0; rect.width = 0;
} }
_gtk_bubble_window_popup (GTK_BUBBLE_WINDOW (priv->selection_bubble), _gtk_bubble_window_set_pointing_to (GTK_BUBBLE_WINDOW (priv->selection_bubble),
GTK_WIDGET (entry), &rect, GTK_POS_TOP); &rect);
gtk_widget_show (priv->selection_bubble);
priv->selection_bubble_timeout_id = 0; priv->selection_bubble_timeout_id = 0;
} }
@ -9479,7 +9483,7 @@ gtk_entry_selection_bubble_popup_unset (GtkEntry *entry)
priv = entry->priv; priv = entry->priv;
if (priv->selection_bubble) if (priv->selection_bubble)
_gtk_bubble_window_popdown (GTK_BUBBLE_WINDOW (priv->selection_bubble)); gtk_widget_hide (priv->selection_bubble);
if (priv->selection_bubble_timeout_id) if (priv->selection_bubble_timeout_id)
{ {