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/gui_utils.c | |
parent | f5e072a2c3fb913bf4615bee77e8f4b7fd14dae8 (diff) |
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/gui_utils.c')
-rw-r--r-- | ui/gtk/gui_utils.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ui/gtk/gui_utils.c b/ui/gtk/gui_utils.c index 62607ca430..5d72960f3d 100644 --- a/ui/gtk/gui_utils.c +++ b/ui/gtk/gui_utils.c @@ -186,7 +186,8 @@ window_new(GtkWindowType type, GtkWidget * window_new_with_geom(GtkWindowType type, const gchar *title, - const gchar *geom_name) + const gchar *geom_name, + GtkWindowPosition pos) { window_geometry_t geom; GtkWidget *win = window_new(type, title); @@ -203,6 +204,17 @@ window_new_with_geom(GtkWindowType type, geom.set_size = TRUE; geom.set_maximized = FALSE; /* don't maximize until window is shown */ window_set_geometry(win, &geom); + } else if (pos != GTK_WIN_POS_NONE) { +#ifdef _WIN32 + /* Testing using GTK+ 2.24.10 shows that + * GTK_WIN_POS_CENTER_ON_PARENT doesn't seem to work on Windows, so + * use the next best thing. Is this a problem for all OS's though, + * or just Windows? Unknown. (Tested with Windows XP SP3 32-bit) + */ + if (pos == GTK_WIN_POS_CENTER_ON_PARENT) + pos = GTK_WIN_POS_CENTER; +#endif + gtk_window_set_position(GTK_WINDOW(win), pos); } } |