aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/simple_dialog.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2004-05-17 21:15:28 +0000
committerUlf Lamping <ulf.lamping@web.de>2004-05-17 21:15:28 +0000
commit9ade33284d8025fbf0e38fb0a7b928579d87d4f7 (patch)
treee017a196ba7a45f1a034e4ed59f642ff5df28834 /gtk/simple_dialog.c
parent374135cb4ad76b5734de84b6635907625c1e5f59 (diff)
GTK2 only: catch window state event, and call display_queued_messages()
if window not iconified any longer. Queue up simple_dialog messages, if window *is* iconified svn path=/trunk/; revision=10914
Diffstat (limited to 'gtk/simple_dialog.c')
-rw-r--r--gtk/simple_dialog.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c
index 3f19eff5c8..3d467843a8 100644
--- a/gtk/simple_dialog.c
+++ b/gtk/simple_dialog.c
@@ -1,7 +1,7 @@
/* simple_dialog.c
* Simple message dialog box routines.
*
- * $Id: simple_dialog.c,v 1.33 2004/05/16 18:42:55 ulfl Exp $
+ * $Id: simple_dialog.c,v 1.34 2004/05/17 21:15:28 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -273,25 +273,16 @@ vsimple_dialog(gint type, gint btn_mask, const gchar *msg_format, va_list ap)
state = gdk_window_get_state(top_level->window);
}
- /* If the main window is iconified, don't show the dialog, and don't
- queue up the message for later display. If showing up a dialog,
- while main window is iconified, program will become unresponsive!
- If it would be queued, there's no point to show the dialog. So it's not
- shown until another one is shown, which will be very confusing.
-
- XXX - get a callback when main window is shown again and call
- display_queued_messages() in this callback. And of course, queue up
- the message for display until this happens */
- if (state & GDK_WINDOW_STATE_ICONIFIED) {
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Discarded message, while main window iconified:\n%s", message);
- g_free(message);
- return NULL;
- }
-#endif
+ /* If we don't yet have a main window or it's iconified, don't show the
+ dialog. If showing up a dialog, while main window is iconified, program
+ will become unresponsive! */
+ if (top_level == NULL || state & GDK_WINDOW_STATE_ICONIFIED) {
+#else
/* If we don't yet have a main window, queue up the message for later
display. */
if (top_level == NULL) {
+#endif
queued_message = g_malloc(sizeof (queued_message_t));
queued_message->type = type;
queued_message->btn_mask = btn_mask;