aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2004-09-08 19:29:09 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2004-09-08 19:29:09 +0000
commit42a7cca75fcf17ba1aad85d8f188fdd4b0dc3693 (patch)
tree9e0744ef5b7518708686be622a7b716dbd341dd3 /gtk
parent98be996b9992d996bd50e63a03d0ff7338fd62c3 (diff)
Try to get the window geometry only, if a GdkWindow really exists for that GtkWidget (e.g. the widget isn't hidden)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11944 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk')
-rw-r--r--gtk/ui_util.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk/ui_util.c b/gtk/ui_util.c
index 2e50b767ac..eebc6923e2 100644
--- a/gtk/ui_util.c
+++ b/gtk/ui_util.c
@@ -517,13 +517,17 @@ window_destroy(GtkWidget *win)
window_geometry_t geom;
const gchar *name;
- /* this must be done *before* destroy is running, as the window geometry */
- /* cannot be retrieved at destroy time (so don't use event "destroy" for this) */
- window_get_geometry(win, &geom);
-
- name = OBJECT_GET_DATA(win, WINDOW_GEOM_KEY);
- if(name) {
- window_geom_save(name, &geom);
+ /* get_geometry must be done *before* destroy is running, as the window geometry
+ * cannot be retrieved at destroy time (so don't use event "destroy" for this) */
+ /* ...and don't do this at all, if we currently have no GdkWindow (e.g. if the
+ * GtkWidget is hidden) */
+ if(!GTK_WIDGET_NO_WINDOW(win)) {
+ window_get_geometry(win, &geom);
+
+ name = OBJECT_GET_DATA(win, WINDOW_GEOM_KEY);
+ if(name) {
+ window_geom_save(name, &geom);
+ }
}
gtk_widget_destroy(win);