diff options
author | Ross Burton <rburton@src.gnome.org> | 2004-11-23 10:08:50 +0000 |
---|---|---|
committer | Ross Burton <rburton@src.gnome.org> | 2004-11-23 10:08:50 +0000 |
commit | 04476d04fed7f5cbca232030121acca61d549116 (patch) | |
tree | daef1f8eb7afb863ddf3636ed0e9df98934ce32f /src | |
parent | Updated British translation. (diff) | |
download | zenity-04476d04fed7f5cbca232030121acca61d549116.tar.gz zenity-04476d04fed7f5cbca232030121acca61d549116.tar.bz2 zenity-04476d04fed7f5cbca232030121acca61d549116.zip |
Check the xterm window ID is valid before using it
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -272,8 +272,16 @@ transient_get_xterm (void) if (wid_str) { char *wid_str_end; Window wid = strtoul (wid_str, &wid_str_end, 10); - if (*wid_str != '\0' && *wid_str_end == '\0' && wid != 0) + if (*wid_str != '\0' && *wid_str_end == '\0' && wid != 0) { + XWindowAttributes attrs; + gdk_error_trap_push (); + XGetWindowAttributes (GDK_DISPLAY(), wid, &attrs); + gdk_flush(); + if (gdk_error_trap_pop () != 0) { + return None; + } return wid; + } } return None; } |