Skip to content

Fix GTK keyboard event crash before initialization#50

Open
richyo-codes wants to merge 1 commit into
libnativeapi:mainfrom
richyo-codes:fix-gtk-keyboard-crash
Open

Fix GTK keyboard event crash before initialization#50
richyo-codes wants to merge 1 commit into
libnativeapi:mainfrom
richyo-codes:fix-gtk-keyboard-crash

Conversation

@richyo-codes

Copy link
Copy Markdown

GTK can deliver keyboard events during startup or focus changes before the keyboard state is initialized. The event handler previously dereferenced the missing state, which could cause a null pointer crash and trigger Gdk-CRITICAL from gdk_keymap_get_direction: assertion 'GDK_IS_KEYMAP (keymap)' failed.

Validate the keyboard state before processing events and safely ignore events received before initialization completes. Normal behavior is unchanged once the backend is ready.

GTK can deliver keyboard events during startup or focus changes before the keyboard state is initialized. The event handler previously dereferenced the missing state, which could cause a null pointer crash and trigger Gdk-CRITICAL from gdk_keymap_get_direction: assertion 'GDK_IS_KEYMAP (keymap)' failed.

Validate the keyboard state before processing events and safely ignore events received before initialization completes. Normal behavior is unchanged once the backend is ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant