-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Sway crashes if 'pt' used for resize set width/height units, instead of 'px' #8619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
Not working as intended
Comments
Can you try again with the latest Sway commit? See https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject |
Yes. Still crashes. Sway log: [same gist, look for "20250322:173203_sway-git.log ] gdb: [same gist, look for "20250322_sway-git_crash_gdb.log " ] |
sahinf
added a commit
to sahinf/sway
that referenced
this issue
Apr 1, 2025
problem: an invalid usage of the command `resize set` will cause sway to crash because it doesn't check for an invalid height. solution: 1. validate height along with width 2. collect all the resize returns into a var in order to log potential errors before returning, so the user has more context as to why the resize config did not work. fixes swaywm#8619
sahinf
added a commit
to sahinf/sway
that referenced
this issue
Apr 2, 2025
problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height. solution: validate height along with width. fixes swaywm#8619
sahinf
added a commit
to sahinf/sway
that referenced
this issue
Apr 11, 2025
problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height. solution: validate height along with width. fixes swaywm#8619
sahinf
added a commit
to sahinf/sway
that referenced
this issue
Apr 13, 2025
problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height. solution: validate height along with width. fixes swaywm#8619 collect errors of all cmd_resize variations and bubble them up Log invalid command usage without this, the invalid command usages from the config criteria do not get logged or printed to the user anywhere.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sway Version:
sway version 1.9
Debug Log:
https://gist.github.com/scott092707/1a9d3220123569157d85762c0698180d
Configuration File:
(minimally altered config)
[See above gist]
Stack Trace:
[See above gist]
Description:
The file manager I use [Caja] exhibits odd behaviour, and the devs wanted me to see if it did so with windows that were floating, as well as tiled.
I wished to have it in exactly the same position as when tiled, so I tried to position/size it with percentages. This failed, for some reason.
I switched to using pixels, with the exact position/size as the tiled version (right half of a tiled 4K monitor, the other half being my text editor [featherpad]).
I goofed up, and wrote 'pt' instead of 'px' for the positioning/sizing units.
This causes Sway to crash (!). [Dumped back at the login-manager [SDDM]]
After I booted with a live-usb and edited the for_window to remove all floating/position/size aspects, and rebooted, all was well.
I copied my usual config out of the way, and altered the standard 1.9 config minimally to use the bum for_window, and launch caja as usual,
I logged out/in, and Sway still crashed.
Odd, that such a minor syntax error could crash Sway...!
-------------------------------------------------------- snippets from config and sway log ------------------------------------------------------
for_window [app_id="[Cc]aja"] {
floating enable
move position 1920 pt 65 pt
resize set width 1920 pt
resize set height 2095 pt
}
00:00:01.170 [DEBUG] [sway/tree/view.c:518] for_window '[app_id="[Cc]aja"]' matches view 0x55633253cce0, cmd: 'move position 1920 pt 65 pt'
00:00:01.170 [INFO] [sway/commands.c:261] Handling command 'move position 1920 pt 65 pt'
00:00:01.170 [DEBUG] [sway/tree/view.c:513] Checking criteria [app_id="[Cc]aja"]
00:00:01.170 [DEBUG] [sway/tree/view.c:518] for_window '[app_id="[Cc]aja"]' matches view 0x55633253cce0, cmd: 'resize set width 1920 pt'
00:00:01.170 [INFO] [sway/commands.c:261] Handling command 'resize set width 1920 pt'
00:00:01.171 [ERROR] [sway/commands/resize.c:405] resize_set_floating:invalid height unit
Odd, that when handling "width" it would ERROR using the word "height"
IMMEDIATELY after this, Sway crashes:
00:00:02.261 [ERROR] [common/ipc-client.c:87] Unable to receive IPC response
The Wayland connection broke. Did the Wayland compositor die?
00:00:00.000 [ERROR] [common/ipc-client.c:67] Unable to connect to /run/user/1000/sway-ipc.1000.361818.sock
Gdk-Message: 20:48:25.249: Error reading events from display: Connection reset by peer
The text was updated successfully, but these errors were encountered: