xapp-status-icon: unrealize GtkStatusIcon before clearing to prevent …#200
Open
leigh123linux wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a crash during Cinnamon restart by ensuring the XEMBED fallback GtkStatusIcon is unrealized (and its underlying GdkWindow removed from GDK’s XID mapping) before the GtkStatusIcon is unreffed/cleared.
Changes:
- Hide (
gtk_status_icon_set_visible(FALSE)) the fallbackGtkStatusIconbefore releasing it. - Pump the main context to allow GDK to process unrealize/destroy before clearing the object.
- Apply the same release pattern in both
sync_skeleton()andxapp_status_icon_dispose().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d31cd53 to
83d3cd5
Compare
83d3cd5 to
2bb926b
Compare
2bb926b to
f4d4fe9
Compare
…stale GdkWindow XID mappings crashing during Cinnamon restart
f4d4fe9 to
3bafd1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…stale GdkWindow XID mappings crashing during Cinnamon restart.
When Cinnamon restarts, the systray socket X window is destroyed while
xapp-sn-watcher is still running. GDK receives a DestroyNotify for the
GtkStatusIcon plug window and crashes in gdk_event_source_get_filter_window()
because the GdkWindow wrapper has already been finalized.
Defer destruction by hiding the icon first and scheduling the final unref
via g_idle_add_full() with g_object_unref as the GDestroyNotify, so the
unref happens reliably whether or not the idle source runs before shutdown.
All signal handlers are disconnected via g_signal_handlers_disconnect_by_data()
before hiding and deferring, so no callback can fire against a stale self
pointer after the deferred unref is queued.
The deferred pattern is applied consistently in sync_skeleton(),
xapp_status_icon_dispose(), and use_gtk_status_icon() so all code paths
are covered.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2443525