Repository navigation
[GTK] Hook the unrealize signal for Widget.UNREALIZE - #3754
Open
openaudible wants to merge 1 commit into
Open
openaudible wants to merge 1 commit into
openaudible wants to merge 1 commit into
Conversation
Display looked up the "realize" signal for Widget.UNREALIZE, so Control.gtk_unrealize ran at the start of every realize and never on a real unrealize. The IM context of a Composite therefore kept a pointer to the client GdkWindow after that window was destroyed. When the widget was realized again, gtk_im_context_set_client_window(im, 0) passed the freed window to GtkIMMulticontext, which crashed in gdk_window_get_screen. Seen on GTK 3.24.49 (Debian 13) without ibus: a TabFolder page created in a realized dialog is unrealized by TabItem.setControl and crashes when it is realized again while the dialog computes its initial size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Please sign ECA https://api.eclipse.org/git/eca/status/gh/eclipse-platform/eclipse.platform.swt/3754 . It's mandatory for even looking at your PR. |
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.
Display.initializeCallbackslooks up therealizesignal forWidget.UNREALIZE:So
Control.gtk_unrealizeruns at the start of every realize, and never on a real unrealize. A Composite's IM context then keeps a pointer to the clientGdkWindowafter that window is destroyed. When the widget is realized again,gtk_im_context_set_client_window (im, 0)hands the freed window toGtkIMMulticontext, which crashes:It comes before the segfault as
Gdk-CRITICAL: gdk_window_get_screen: assertion 'GDK_IS_WINDOW (window)' failed, thengtk_settings_get_for_screenandg_signal_handlers_disconnect_matchedcriticals.Reproduction: GTK 3.24.49 (Debian 13 / Devuan 6), X11, no ibus (
GTK_IM_MODULEandXMODIFIERSunset). A JFace dialog with a nativeTabFolderwhose pages are created in the already realized shell:TabItem.setControlunrealizes each page, and the next realize (hereText.computeSizeduringgetInitialSize) crashes. With ibus active the stale pointer goes unnoticed.Fix: add
OS.unrealizeand look up"unrealize". Verified on Debian 13: the dialog crashed every time before the change and opens and closes cleanly after it.🤖 Generated with Claude Code