diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-05-17 21:15:28 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-05-17 21:15:28 +0000 |
commit | 1dd512ba6c9e74e4cd9314b23a8617a42645c8e4 (patch) | |
tree | e017a196ba7a45f1a034e4ed59f642ff5df28834 /gtk/simple_dialog.c | |
parent | d15d3fb9c074118f385415b1ad9e88d40b58530c (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
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10914 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/simple_dialog.c')
-rw-r--r-- | gtk/simple_dialog.c | 23 |
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; |