Repository navigation
gtk: fix quick terminal breaking when manually toggled off while auto-hide is enabled - #12471
Merged
mitchellh merged 1 commit intoApr 27, 2026
Merged
Conversation
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.
Fixes quick terminal breaking when auto-hide is enabled and quick terminal is manually toggled off (#11679).
quick-terminal-autohideis implemented by theWindow.propIsActivefunction inapprt/gtk/class/window.zigwhich callsWindow.toggleVisibilitywhen the quick terminal window becomes inactive (loses focus). HoweverWindow.propIsActiveis also triggered when you manually hide the quick terminal because hiding it causes the window to become inactive. Normally that should just toggle the quick terminal off and immediately back on, but there is also a re-entrancy issue. Manually toggling off the terminal causes theApplication.toggleQuickTerminal(inapprt/gtk/class/application.zig) to run which sets off the call chainWindow.toggleVisibility -> gtk_widget_set_visible -> ... GTK signal/event handling ... -> Window.propIsActive -> Window.toggleVisibility -> gtk_widget_set_visible.The nested calls to
gtk_widget_set_visiblecause the GTK window state to become corrupted. The window is marked visible, but is not actually visible or just shows a placeholder. What exactly happens depends on the compositor and how it handles moving window focus.Reproduced the bug on KDE and hyprland and verified the fix on both.
Changes
apprt/gtk/class/window.zig: added check toWindow.propIsActiveto only toggle quick-terminal if it is inactive and visible.AI Disclosure
Found the bug without AI using "printf debugging" then traced it through GTK with valgrind. Used GPT5.4 in setting up valgrind and researching how signals/events move through GTK internally.