Re: [gtk-list] Strange "delete_event" and "destroy_event"




Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz> writes:

>   I think that last gtk+0.99.2 introduce new bug in "delete_event" - I noticed
> this bug in some Gimp and testgtk windows (Gimp/File/Preferences,Gimp/File/New,
> all testgtk windows... etc):
> 
>   Try to close the window from your window manager but DO NOT move your mouse -
> just click in you favourite window corner (this bug is not window manager
> specific - I tried it with two different window managers - so do not flame me :)

I hope we are more polite than that! I don't think anybody has been
flamed for a bug report on this list yet.

> - but nothing happens, window is still on the screen. Now you can move your
> mouse - bang - window is closed.
> 
>   I did not examined this bug closely but it seems to me that it is independend
> to style of window destruction (return TRUE from delete_event or other...) 
> 
>   I know that this bug is really small one - but.... - but sometimes it is very
> disturbing when window closes when _it_ wants. What do you think? Is this bug or
> I just missed something (it is 12:38 AM :) ?

It is a bug. I see it too. It actually is indicative of some fairly
deep problems with reference counting. The problem is that there is
confusion between destroying a widget on screen and destroying it in
memory.

In particular, the problem can be tracked down to these lines of code
in gtkmain.c:

	case GDK_DELETE:
 	  gtk_object_ref (GTK_OBJECT (event_widget));
	  if (gtk_widget_event (event_widget, event))
	    gtk_widget_destroy (event_widget);
 	  gtk_object_unref (GTK_OBJECT (event_widget));
	  break;

gtk_object_unref doesn't actually try to destroy the object when the
reference count is decremented to zero! So the window gets destroyed
later on.  While a quick fix could be cooked up (just removing the
_ref/_unref pair should usually work OK), I'm not inclined to spend
too much effort on this until we get Marius's refcounting for objects
changes in to fix up the fundamentals.

>   Pinable menus
definitely would be nice, IMO.
>   Pie menus  
I think they are more of a L&F thing than a feature - that is, it
would be a bad idea to have both normal menus and pie menus in
the same application. I suppose if we ever get adjustable
look-and-feels, then perhaps there could be a setup where all popup
menus were pie menus. Don't hold your breath though...

>  > TODO BEFORE GTK 1.0
>  >-------------------
> 
>   It would be nice if guile-gtk and GtkGL became part of standard gtk
> distribution archive (or at least aviable from ftp.gimp.org/pub/gtk).

They really don't belong in the main tar file. For one thing, they
both require outside software and would give more configuration
headaches. Plus, I think separate distribution works fine. If the
authors wanted to distribute them that way, I'm sure they would be
welcome on gimp.org.

Regards,
                                        Owen



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