GNOME Bugzilla – Bug 548993
regression: gdk 2.13 leaves stray windows in certain cases
Last modified: 2009-05-30 23:44:21 UTC
THis bug was first reported as https://bugs.freedesktop.org/show_bug.cgi?id=16817 and https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/250769 Swfdec-mozilla uses gdk_window_new() on a parent window created via gdk_window_foreign_new() and then gdk_window_add_filter(). This way it gets its own GDK window while Firefox can continue running in the background. Sice GTK 2.13 this window is not automatically destroyed anymore when the browser page is closed, but instead happily hovers above the browser causing crashes. We have tested that this bug is related to GTK, as it happens with GTK 2.13, but not 2.12 with identical Swfdec and Firefox versions. I'm marking this as major as it's a regression to 2.12.
It seems to be caused by commit in revision 20695: 2008-06-27 Emmanuele Bassi <ebassi@gnome.org> Abstract some GdkWindow API into an interface that the backends must implement. (based on a patch by Alex Larsson) * gdk/Makefile.am: Add gdkwindowimpl.[ch] * gdk/gdk.symbols: Move symbols around. * gdk/gdkinternals.h: * gdk/gdkwindowimpl.[ch]: Move some of the GdkWindow API we require from the backends to a GInterface that the backends should implement instead. * gdk/gdkwindow.c: Provide some of the GdkWindow public API as a wrapper call around the GdkWindowImpl interface vtable. * gdk/x11/gdkevents-x11.c: * gdk/x11/gdkgeometry-x11.c: * gdk/x11/gdkprivate-x11.h: * gdk/x11/gdkwindow-x11.c: * gdk/x11/gdkwindow-x11.h: Update the X11 backend to implement the GdkWindowImpl interface.
Created attachment 117367 [details] [review] swfdec-window-leak.patch This seems to work (and it's the obvious behaviour change in the diff Priit pointed to above). Need to consult with Emmanuele/Alex about what the show in gdk_window_reparent is for, though.
I was merely porting from Alex's code - which was against 2.8. :-( admittedly, I never tested it with firefox+swfdec. my bad. Ed: your patch looks fine to me.
I assume we want to change other backends reparent implementations to return FALSE, too ?
I can confirm the patch fixes the swfdec regression.
I can confirm it, too.
2008-08-27 Matthias Clasen <mclasen@redhat.com> * gdk/x11/gdkwindow-x11.c: * gdk/win32/gdkwindow-win32.c: Return FALSE from reparent implementations to avoid #548993. Patch by Ed Catmur.
(In reply to comment #2) > Need to consult with Emmanuele/Alex about what the show in gdk_window_reparent > is for, though. Doc says "The window being reparented will be unmapped as a side effect." So the show block can't be right because it is the total opposite. :)
Is there any other reason for this bug to stay open?
I don't think so. For the last problem Bug 546817 is probably more appropriate.