Skip to content

xapp-status-icon: unrealize GtkStatusIcon before clearing to prevent …#200

Open
leigh123linux wants to merge 1 commit into
linuxmint:masterfrom
leigh123linux:xapp-status-icon-unrealize-GtkStatusIcon
Open

xapp-status-icon: unrealize GtkStatusIcon before clearing to prevent …#200
leigh123linux wants to merge 1 commit into
linuxmint:masterfrom
leigh123linux:xapp-status-icon-unrealize-GtkStatusIcon

Conversation

@leigh123linux
Copy link
Copy Markdown
Member

@leigh123linux leigh123linux commented May 15, 2026

…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

@leigh123linux leigh123linux requested a review from Copilot May 15, 2026 23:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 fallback GtkStatusIcon before 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() and xapp_status_icon_dispose().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libxapp/xapp-status-icon.c Outdated
Comment thread libxapp/xapp-status-icon.c Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread libxapp/xapp-status-icon.c Outdated
@leigh123linux leigh123linux force-pushed the xapp-status-icon-unrealize-GtkStatusIcon branch from 83d3cd5 to 2bb926b Compare May 16, 2026 00:48
@leigh123linux leigh123linux requested a review from Copilot May 16, 2026 00:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment thread libxapp/xapp-status-icon.c
Comment thread libxapp/xapp-status-icon.c
Comment thread libxapp/xapp-status-icon.c Outdated
Comment thread libxapp/xapp-status-icon.c Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread libxapp/xapp-status-icon.c Outdated
Comment thread libxapp/xapp-status-icon.c Outdated
Comment thread libxapp/xapp-status-icon.c
@leigh123linux leigh123linux force-pushed the xapp-status-icon-unrealize-GtkStatusIcon branch from 2bb926b to f4d4fe9 Compare May 16, 2026 01:26
@leigh123linux leigh123linux requested a review from Copilot May 16, 2026 01:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread libxapp/xapp-status-icon.c Outdated
Comment thread libxapp/xapp-status-icon.c
…stale GdkWindow XID mappings crashing during Cinnamon restart
@leigh123linux leigh123linux force-pushed the xapp-status-icon-unrealize-GtkStatusIcon branch from f4d4fe9 to 3bafd1b Compare May 16, 2026 01:38
@leigh123linux leigh123linux requested a review from Copilot May 16, 2026 01:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@leigh123linux leigh123linux requested a review from mtwebster May 16, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants