Re: Updated unexpected window destruction patch.




Nat Friedman <nat@nat.org> writes:

> Index: gdk/gdkprivate.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/gdkprivate.h,v
> retrieving revision 1.36
> diff -u -r1.36 gdkprivate.h
> --- gdk/gdkprivate.h	1999/02/24 07:33:09	1.36
> +++ gdk/gdkprivate.h	1999/08/24 18:03:44
> @@ -241,6 +241,8 @@
>  
>  void gdk_window_add_colormap_windows (GdkWindow *window);
>  void gdk_window_destroy_notify	     (GdkWindow *window);
> +/* Take note: gdk_window_destroy_notify_new will be removed in 1.3 */
> +void gdk_window_destroy_notify_new   (GdkWindow *window, GdkEvent *event);

a) If you are calling this function outside of GDK, we need 
   to move it from gdkprivate.h. gdkprivate.h is in fact
   private, and is only installed to support the GDK_*
   macros in gdkx.h

b) If we introduce gdk_window_destroy_notify_new() in 1.2,
   we can't remove it without good reason in 1.3. Rather,
   it will be _deprecated_ in favor of of a revised
   gdk_window_destroy_notify() in 1.3.

   [ if we don't figure out a better way of dealing with
     these situations in general ]

> -      else
> +      else {
> +	GdkWindowPrivate *parent;

The '{' needs to go on a new line, and it looks like you
are missing some indentation.

> +  parent_class = gtk_type_new (GTK_TYPE_WINDOW);

Urk. If you copied this from some place, we need to
fix whereever you copied it from. This creates a
_new_ class. 

  parent_class = gtk_type_class (GTK_TYPE_WINDOW);

please.

> +      gdk_window_set_user_data (plug->socket_window, NULL);
> +      gdk_window_destroy (plug->socket_window);

Urk. Is this "an eye-for-an-eye?" Destroying windows
of other applications is _wrong_. You want 
gdk_window_unref() here.

Generally, it is looking OK. I'll see about applying
it when I get back tomorrow.

                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]