! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Gtk-CRITICAL when closing main window
Status:
RESOLVED: FIXED

Comments

Description Theo Linkspfeifer editbugs 2019-06-23 22:53:43 CEST
Created attachment 8671 
trace log

gdk_window_set_cursor: assertion 'GDK_IS_WINDOW (window)' failed

How to reproduce:
- copy some file
- close main window.
Comment 1 Reuben Green editbugs 2019-07-25 10:16:22 CEST
Created attachment 8813 
Patch to fix bug 15635

Small patch to fix this (it just swaps the order of two lines of code).

After some experimenting, I found that thunar_clipboard_manager_dispose was being called during the unrealize-ing of the window. When the clipboard is non-empty, this results in a call to gtk_clipboard_store. This call runs a glib event loop, which then processes signals that are ultimately passed to the window's GtkPaned member, which is in a bad state due to being part-way through unrealize-ation, and  this causes the error. The patch fixes this by waiting until after the GtkWidget class has unrealize the window before calling g_object_unref on the clipboard manager.

So I suppose this is really a gtk bug, since gtk is allowing widgets to receive signals while in a bad state?

Also this is my first go at submitting a patch, so if I have done something wrong/badly (either in the patch itself or the submission process), please let me know!
Comment 2 Git Bot editbugs 2019-07-26 13:43:59 CEST
Reuben Green referenced this bugreport in commit 9c0d4a03ec3287b4b1fbc28b451dc78ad6f06d68

Prevent premature disposal of clipboard manager (Bug 15635)

https://git.xfce.org/xfce/thunar/commit?id=9c0d4a03ec3287b4b1fbc28b451dc78ad6f06d68
Comment 3 Git Bot editbugs 2019-07-26 13:48:06 CEST
Reuben Green referenced this bugreport in commit ca761593d4db7d186b2029f4567bec1ef4ade0ce

Prevent premature disposal of clipboard manager (Bug 15635)

https://git.xfce.org/xfce/thunar/commit?id=ca761593d4db7d186b2029f4567bec1ef4ade0ce
Comment 4 alexxcons editbugs 2019-07-26 13:56:28 CEST
(In reply to Reuben Green from comment #1)
> Created attachment 8813 
> Patch to fix bug 15635
> 
Welcome!
Your patch looks good to me and seems to fix the bug.
Formatting, commit message, etc, all is fine (iirc first time everything seems to be ok on a "first patch" :P ) 

Pushed it to master and 4.14 branch.

I as well would assume to receive at least some dedicated Warning / Error when a widget reveives a signal in while in a bad state.
( Though I dont know much about gtk internals)

Best open a bug for it on https://gitlab.gnome.org/GNOME/gtk and see what the devs tell (or first search if such a bug already exists)

Thanks for your contribution !
Comment 5 Reuben Green editbugs 2019-08-03 01:29:21 CEST
Quick follow-up to this bug: after a little work, I discovered that the root cause of this bug was indeed a bug in gtk 3.24. I opened an issue against this bug (https://gitlab.gnome.org/GNOME/gtk/issues/2066) and submitted a fix for it (https://gitlab.gnome.org/GNOME/gtk/merge_requests/1033), which has now been accepted.
Comment 6 alexxcons editbugs 2019-08-03 23:15:07 CEST
Thanks for the info! Well done !

Bug #15635

Reported by:
Theo Linkspfeifer
Reported on: 2019-06-23
Last modified on: 2019-08-03

People

Assignee:
Xfce Bug Triage
CC List:
2 users

Version

Attachments

trace log (35.20 KB, application/octet-stream)
2019-06-23 22:53 CEST , Theo Linkspfeifer
no flags
Patch to fix bug 15635 (1.10 KB, patch)
2019-07-25 10:16 CEST , Reuben Green
no flags

Additional information