aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-30 09:05:17 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-30 09:05:17 +0800
commitb14590968a2d3fe382797c608046afdeb93538b8 (patch)
tree30bc06bd298d9b5412cc79cf2ae15be13d09e2ca /widgets/text
parentad97ddd68a45ec03a36b25d99ff957a472a1e588 (diff)
downloadgsoc2013-evolution-b14590968a2d3fe382797c608046afdeb93538b8.tar.gz
gsoc2013-evolution-b14590968a2d3fe382797c608046afdeb93538b8.tar.zst
gsoc2013-evolution-b14590968a2d3fe382797c608046afdeb93538b8.zip
Added. Makes our popup window a transient of the toplevel.
2001-10-29 Jon Trowbridge <trow@ximian.com> * gal/e-text/e-entry.c (e_entry_make_completion_window_transient): Added. Makes our popup window a transient of the toplevel. (e_entry_enable_completion_full): Try to make our popup a transient. (e_entry_realize): Also try to make our popup a transient here, in case the entry wasn't packed before we enabled completion. This is all an attempt to fix bug #13791. svn path=/trunk/; revision=14390
Diffstat (limited to 'widgets/text')
-rw-r--r--widgets/text/e-entry.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c
index 10f5fd8e2a..47bbca0079 100644
--- a/widgets/text/e-entry.c
+++ b/widgets/text/e-entry.c
@@ -129,6 +129,7 @@ struct _EEntryPrivate {
guint draw_borders : 1;
guint emulate_label_resize : 1;
+ guint have_set_transient : 1;
gint last_width;
};
@@ -750,6 +751,25 @@ key_release_cb (GtkWidget *w, GdkEventKey *ev, gpointer user_data)
return rv;
}
+static void
+e_entry_make_completion_window_transient (EEntry *entry)
+{
+ GtkWidget *w;
+
+ if (entry->priv->have_set_transient || entry->priv->completion_view_popup == NULL)
+ return;
+
+ w = GTK_WIDGET (entry)->parent;
+ while (w && ! GTK_IS_WINDOW (w))
+ w = w->parent;
+
+ if (w) {
+ gtk_window_set_transient_for (GTK_WINDOW (entry->priv->completion_view_popup),
+ GTK_WINDOW (w));
+ entry->priv->have_set_transient = 1;
+ }
+}
+
void
e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint delay, EEntryCompletionHandler handler)
{
@@ -808,6 +828,8 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del
entry->priv->completion_view_popup = gtk_window_new (GTK_WINDOW_POPUP);
+ e_entry_make_completion_window_transient (entry);
+
gtk_signal_connect (GTK_OBJECT (entry->item->model),
"cancel_completion",
GTK_SIGNAL_FUNC (cancel_completion_cb),
@@ -1215,6 +1237,8 @@ e_entry_realize (GtkWidget *widget)
entry = E_ENTRY (widget);
+ e_entry_make_completion_window_transient (entry);
+
if (entry->priv->emulate_label_resize) {
d(g_print("%s: queue_resize\n", __FUNCTION__));
gtk_widget_queue_resize (GTK_WIDGET (entry->canvas));