From 14f120f13194b4e42a2751d0b9db82451667eeeb Mon Sep 17 00:00:00 2001 From: Thomas Andersen Date: Wed, 19 Apr 2006 20:55:49 +0000 Subject: [PATCH] warn and ignore if transient_for is set to a non-top-level window. Fixes 2006-04-19 Thomas Andersen * src/window-props.c (reload_transient_for): warn and ignore if transient_for is set to a non-top-level window. Fixes #335524. --- ChangeLog | 5 +++++ src/window-props.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1df352fd1..981afe363 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-19 Thomas Andersen + + * src/window-props.c (reload_transient_for): warn and ignore if + transient_for is set to a non-top-level window. Fixes #335524. + 2006-04-19 Björn Lindqvist * src/frames.c (struct CachedPixels, meta_frames_destroy, diff --git a/src/window-props.c b/src/window-props.c index 63696a119..a1348279c 100644 --- a/src/window-props.c +++ b/src/window-props.c @@ -1130,6 +1130,17 @@ reload_transient_for (MetaWindow *window, if (value->type != META_PROP_VALUE_INVALID) window->xtransient_for = value->v.xwindow; + /* Make sure transient_for is valid */ + if (window->xtransient_for != None && + meta_display_lookup_x_window (window->display, + window->xtransient_for) == NULL) + { + window->xtransient_for = None; + meta_warning (_("Invalid WM_TRANSIENT_FOR window 0x%lx specified " + "for %s.\n"), + window->xtransient_for, window->desc); + } + window->transient_parent_is_root_window = window->xtransient_for == window->screen->xroot;