Using `--toggle-visibility` Too Quickly Causes Panel To Become Permanently Hidden.
Describe the bug
When toggling a panel using --toggle-visibility
too quickly, the panel cannot be shown again. This issue was encountered naturally when accidentally holding down the Super key + U key for too long. The Super key + U key is bound in the sway config to a command similar to the one below. A high repeat rate is also a contributing factor to this issue.
To Reproduce
Steps to reproduce the behavior:
- Run the following command in bash:
panel_command="kitty +kitten panel --single-instance --toggle-visibility kitten run-shell"
$panel_command & sleep 1; while true; do echo toggling; $panel_command; sleep .1; done
If the panel continues to toggle correctly, press Ctrl+C and reduce the second sleep in $panel_command
and then rerun the while loop.
You can also just bind the panel command in your window manager and hold down the key if you have a high repeat rate. A repeat rate of 35 is what is used and reliably reproduces this bug.
Environment details
System Information
- kitty: 0.41.1 created by Kovid Goyal
- Linux: desk 6.14.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Apr 2025 18:43:59 +0000 x86_64
- Sway: version 1.11-rc1-003ae043 (Apr 20 2025, branch 'tabbed-stacked-layout-gaps')
- OpenGL: '4.6 (Core Profile) Mesa 25.0.3-arch1.1' Detected version: 4.6
- Frozen: False
Fonts
- medium: VictorMono-Regular: /home/alex/.local/share/fonts/VictorMono/WOFF2/VictorMono-Regular.woff2:0
- bold: VictorMono-Bold: /home/alex/.local/share/fonts/VictorMono/WOFF2/VictorMono-Bold.woff2:0
- italic: VictorMono-Regular: /home/alex/.local/share/fonts/VictorMono/WOFF2/VictorMono-Regular.woff2:0
- bi: VictorMono-Bold: /home/alex/.local/share/fonts/VictorMono/WOFF2/VictorMono-Bold.woff2:0
Paths
- kitty: /usr/bin/kitty
- base dir: /usr/lib/kitty
- extensions dir: /usr/lib/kitty/kitty
- system shell: /bin/zsh
System color scheme
- background: #f9f5d7
- color0: #ebdbb2
- color1: #cc241d
- color10: #79740e
- color11: #b57614
- color12: #076678
- color13: #8f3f71
- color14: #427b58
- color15: #282828
- color2: #98971a
- color3: #d79921
- color4: #458588
- color5: #b16286
- color6: #689d6a
- color7: #7c6f64
- color8: #928374
- color9: #9d0006
- cursor: #665c54
- cursor_text_color: #b93
- foreground: #3c3836
- selection_background: #d65d0e
- selection_foreground: #3c3836
- url_color: #458588
Important environment variables seen by the kitty process
- PATH: /home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/share/JetBrains/Toolbox/scripts:/home/alex/.local/bin:/home/alex/.cargo/bin:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin:/var/lib/snapd/snap/bin
- LANG: en_US.UTF-8
- EDITOR: nvim
- SHELL: /bin/zsh
- DISPLAY: :0
- WAYLAND_DISPLAY: wayland-1
- USER: alex
- XCURSOR_SIZE: 24
- XDG_SEAT: seat0
- XDG_SESSION_TYPE: wayland
- XDG_CURRENT_DESKTOP: sway
- XDG_SESSION_CLASS: user
- XDG_VTNR: 1
- XDG_SESSION_ID: 1
- XDG_RUNTIME_DIR: /run/user/1000
- XDG_DATA_DIRS: /home/alex/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
Additional context
Window manager: sway version 1.11-rc1
Possible solutions
The issue may be caused by either GLFW or sway. One possible solution is to perform some sort of debouncing as a workaround. This can be achieved by adding a delay between each toggle command. This will prevent the panel from becoming permanently hidden.
Another possible solution is to modify the sway config to reduce the repeat rate of the Super key + U key. This will prevent the panel from being toggled too quickly.
Conclusion
The issue of the panel becoming permanently hidden when using --toggle-visibility
too quickly is a known issue. It is caused by either GLFW or sway, and can be solved by performing some sort of debouncing or modifying the sway config to reduce the repeat rate of the Super key + U key.
Q: What is the issue with using --toggle-visibility
too quickly?
A: When using --toggle-visibility
too quickly, the panel cannot be shown again. This is because the panel becomes permanently hidden due to the rapid toggling.
Q: What is the cause of this issue?
A: The issue is caused by either GLFW or sway. The exact cause is still unknown, but it is believed to be related to the way that these two libraries handle window visibility.
Q: How can I reproduce this issue?
A: You can reproduce this issue by running the following command in bash:
panel_command="kitty +kitten panel --single-instance --toggle-visibility kitten run-shell"
$panel_command & sleep 1; while true; do echo toggling; $panel_command; sleep .1; done
If the panel continues to toggle correctly, press Ctrl+C and reduce the second sleep in $panel_command
and then rerun the while loop.
Q: What is the recommended solution to this issue?
A: The recommended solution is to perform some sort of debouncing as a workaround. This can be achieved by adding a delay between each toggle command. This will prevent the panel from becoming permanently hidden.
Q: How can I modify my sway config to reduce the repeat rate of the Super key + U key?
A: You can modify your sway config by adding the following line to your sway config file:
bindsym $mod+u toggle-panel delay=100
This will add a 100ms delay between each toggle command.
Q: What are some other possible solutions to this issue?
A: Some other possible solutions to this issue include:
- Modifying the GLFW library to handle window visibility differently
- Modifying the sway library to handle window visibility differently
- Using a different window manager that does not have this issue
Q: Is this issue specific to the Super key + U key combination?
A: No, this issue is not specific to the Super key + U key combination. It can occur with any key combination that is bound to the --toggle-visibility
command.
Q: Can I use a different command to toggle the panel instead of --toggle-visibility
?
A: Yes, you can use a different command to toggle the panel instead of --toggle-visibility
. However, this may require modifying your sway config and may not be as convenient as using the --toggle-visibility
command.
Q: Is this issue a bug or a feature?
A: This issue is a bug. It is a known issue that can be solved by performing some sort of debouncing or modifying the sway config to reduce the repeat rate of the Super key + U key.
Q: Can I get help from the community to solve this issue?
A: Yes, you can get help from the community to solve this issue. You can post on the sway subreddit or ask for help on the sway mailing list.