It doesn't look right to me.
If XGetWindowAttributes returns 0, you did
meta_error_trap_push_with_return() but not
meta_error_trap_pop_with_return().
Shouldn't push and pop be paired?
Ginn
On Apr 29, 2008, at 12:53 PM, C Wang wrote:
> Metacity dump core when remote log in to a Sparc S10 machine from a
> Nv 82+ Sparc box, and then run radiance. The root cause is
> XError occurred when create certain window.
>
> This patch add the routine to check the return value of
> XGetWindowAttribute, and will make metacity not to dump the core
> when XGetWindowAttributes failed. However, the fix is not fix the
> bug from the root, we need Xserver people to look at it then.
>
> Chris
>
> --- core/window.c.old 2008-04-29 12:05:42.314074000 +0800
> +++ core/window.c 2008-04-29 12:06:50.985668000 +0800
> @@ -220,10 +220,8 @@
>
> meta_error_trap_push_with_return (display);
>
> - XGetWindowAttributes (display->xdisplay,
> - xwindow, &attrs);
> -
> - if (meta_error_trap_pop_with_return (display, TRUE) != Success)
> + if (!XGetWindowAttributes (display->xdisplay,xwindow, &attrs) ||
> + (meta_error_trap_pop_with_return (display, TRUE) != Success))
> {
> meta_verbose ("Failed to get attributes for window 0x%lx\n",
> xwindow);
--------
Ginn Chen
Software Engineer, Browser Team
Sun Microsystems, Inc.
Phone: x82869 / +86-10-62673869
Fax: +86-10-62780969