[779] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: crash in gdk_window_destroy

daemon@ATHENA.MIT.EDU (Owen Taylor)
Wed Aug 20 10:54:22 1997

From: Owen Taylor <owt1@cornell.edu>
To: gtk-list@redhat.com
In-reply-to: Your message of "Wed, 20 Aug 1997 15:05:00 BST."
             <9708201404.ZM772@amanita.zands.demon.co.uk> 
Date: Wed, 20 Aug 1997 10:55:41 -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


> It resulted from a grotty hack (ta-daa!) in wm2.  I've fixed it; it
> was really trivial.  Bah.  The window manager was adding an extra
> child window to the application's main X window.  Quite why no other
> X application has ever cared about this is really beyond me.

Since increased robustness is always a good thing, here's a simple
fix for the problem on the GTK (actually GDK) side of things:

*** gdkwindow.c.ots	Wed Aug 20 10:47:03 1997
--- gdkwindow.c	Wed Aug 20 10:47:57 1997
***************
*** 965,971 ****
        for (i = 0; i < nchildren; i++)
  	{
  	  child = gdk_window_lookup (xchildren[i]);
! 	  children = g_list_prepend (children, child);
  	}
  
        XFree (xchildren);
--- 965,972 ----
        for (i = 0; i < nchildren; i++)
  	{
  	  child = gdk_window_lookup (xchildren[i]);
! 	  if (child)
! 	    children = g_list_prepend (children, child);
  	}
  
        XFree (xchildren);

Perhaps it's a bit unusual for a program to go through X to
obtain its own children ...

Regards,
                                        Owen

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post