diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2014-06-19 12:40:11 -0700 |
---|---|---|
committer | Balint Reczey <balint@balintreczey.hu> | 2014-06-19 22:21:05 +0000 |
commit | e07b7953a80af30ad1f7dd51f8c8f773cd514f56 (patch) | |
tree | 76435e218cad8830ce01565d769ec8f60d5bab63 /ui/gtk/dlg_utils.c | |
parent | f5e072a2c3fb913bf4615bee77e8f4b7fd14dae8 (diff) | |
download | wireshark-e07b7953a80af30ad1f7dd51f8c8f773cd514f56.tar.gz |
Save the size and position of the expert info dialog
Set initialize position to center on parent
bug: 3817
Change-Id: Iad48aa762d892908d50f742606160c8305084f48
Reviewed-on: https://code.wireshark.org/review/2459
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Balint Reczey <balint@balintreczey.hu>
Diffstat (limited to 'ui/gtk/dlg_utils.c')
-rw-r--r-- | ui/gtk/dlg_utils.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ui/gtk/dlg_utils.c b/ui/gtk/dlg_utils.c index 36fb2c90ea..28a2875a81 100644 --- a/ui/gtk/dlg_utils.c +++ b/ui/gtk/dlg_utils.c @@ -471,6 +471,42 @@ dlg_window_new(const gchar *title) return win; } +/* Create a dialog box window that belongs to Wireshark's main window. */ +GtkWidget * +dlg_window_new_with_geom(const gchar *title, const gchar *geom_name, GtkWindowPosition pos) +{ + GtkWidget *win; + + win = window_new_with_geom(GTK_WINDOW_TOPLEVEL, title, geom_name ? geom_name : title, pos); + + /* + * XXX - if we're running in the capture child process, we can't easily + * make this window transient for the main process's window. We just + * punt here. + * + * Perhaps the child process should only capture packets, write them to + * a file, and somehow notify the parent process and let *it* do all + * the GUI work. If we can do that efficiently (so that we don't drop + * more packets), perhaps we can also do so even when we're *not* doing + * an "Update list of packets in real time" capture. That'd let the + * child process run set-UID on platforms where you need that in order + * to capture, and might also simplify the job of having the GUI main + * loop wait both for user input and packet arrival. + */ + /* + * On Windows, making the dialogs transient to top_level behaves strangely. + * It is not possible any more to bring the top level window to front easily. + * So we don't do this on Windows. + */ +#ifndef _WIN32 + if (top_level) { + gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(top_level)); + } +#endif /*_WIN32*/ + + return win; +} + /* Create a configuration dialog box window that belongs to Wireshark's * main window and add the name of the current profile name to its title bar */ |