After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 597417 - GDL appears broken with GTK 2.18 client side window support
GDL appears broken with GTK 2.18 client side window support
Status: RESOLVED FIXED
Product: gdl
Classification: Other
Component: general
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: Anjuta maintainers
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-05 13:22 UTC by Jim Hayward
Modified: 2009-11-24 16:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
diff using gdk_window_ensure_native (1.69 KB, patch)
2009-11-24 04:49 UTC, Jim Hayward
none Details | Review
Fixes the issue (885 bytes, patch)
2009-11-24 13:00 UTC, Alexander Larsson
none Details | Review

Description Jim Hayward 2009-10-05 13:22:29 UTC
Not sure if this is a GDL or GTK bug. I was experimenting with GDL and could not get it function properly. Thinking I wasn't doing anything wrong, I compiled test-dock.c as a standalone app. It was also not working. It appears to be an issue with the client side windows in GTK 2.18. If I use "env GDK_NATIVE_WINDOWS=1" then test-code works correctly.

A few errors I was seeing on the console..
gdl-test-dock:2287): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(gdl-test-dock:2287): Gdk-WARNING **: losing last reference to undestroyed window

(gdl-test-dock:2287): GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count > 0' failed

(gdl-test-dock:2287): Gdk-CRITICAL **: gdk_window_move_resize_internal: assertion `GDK_IS_WINDOW (window)' failed

(gdl-test-dock:2287): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `GDK_IS_WINDOW (window)' failed

(gdl-test-dock:2287): Gdk-CRITICAL **: _gdk_window_destroy_hierarchy: assertion `GDK_IS_WINDOW (window)' failed

(gdl-test-dock:2287): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(gdl-test-dock:2287): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(gdl-test-dock:2287): Gdk-WARNING **: losing last reference to undestroyed window
Comment 1 Johannes Schmid 2009-10-05 13:29:19 UTC
Well, I have no gtk 2.18 to test here in the moment but it is of course possible that it breaks with client-side windows. I would just expect gtk+ to be backward-compatible...

IIRC there was a property to force a window to be a "real" X-Window.
Comment 2 Jim Hayward 2009-10-05 15:31:25 UTC
"env GDK_NATIVE_WINDOWS=1" restores the old behavior. test-code.c does work correctly when this is used. Since you don't have 2.18 at the moment I'll see if I have time to do some further debugging. Thanks.
Comment 3 Johannes Schmid 2009-11-23 11:37:39 UTC
You are right, something is horribly broken with client-side windows but gdb doesn't give any useful traces. I am really in need of someone knowing more about client-side windows.
Comment 4 Johannes Schmid 2009-11-23 11:43:01 UTC
Alex, could you give some hints why things might be broken? Gdl does all kind of Gdk low level stuff which probably now fails in some ways.
Comment 5 Jim Hayward 2009-11-23 14:15:40 UTC
Unfortunately not being familiar with the internal gdl code leaves me at a disadvantage in terms of being much help.

The only thing I did try was a few calls to gdk_window_ensure_native() in the gdl code. This seemed to help workaround the problem. However it did not completely fix it.
Comment 6 Johannes Schmid 2009-11-23 22:26:25 UTC
Jim, could you still post it here - maybe it's useful.
Comment 7 Jim Hayward 2009-11-24 04:49:16 UTC
Created attachment 148369 [details] [review]
diff using gdk_window_ensure_native

I attached a diff. The only thing it does is call gdk_window_ensure_native() on three different GdkWindow's created with gdk_window_new(). This does appear to help workaround the problem.
Comment 8 Alexander Larsson 2009-11-24 10:38:18 UTC
From the warnings it seems to me like GDL is unrefing a gdwindow, which it should not (unless it ref:ed it specially before that) as the refs are owned by gdk. 

This was always an error but will not cause immediate problems for native windows since the xserver side has a ref to the window. For native window however there is no additional ref that will keep the window alive, so if you incorrectly unref the window then things will crash/warn.

The correct thing to do is to call gdk_window_destroy() on a window that was allocated with gdk_window_new().
Comment 9 Alexander Larsson 2009-11-24 10:47:55 UTC
Hmm, i don't see any obvious bogus unrefs...
Comment 10 Alexander Larsson 2009-11-24 13:00:18 UTC
Created attachment 148383 [details] [review]
Fixes the issue

It was a bit indirect, gdl_dock_item_grip_unrealize() sets GTK_NO_WINDOW flag and
then calls the parent unrealize handler, which will unref widget->window.

widget->window is set to grip->title_window which at this time is destroyed. Refing it when setting it fixes the issue.
Comment 11 Johannes Schmid 2009-11-24 16:04:03 UTC
Thanks a lot for looking into this!