Skip to content
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

Sway crashes if 'pt' used for resize set width/height units, instead of 'px' #8619

Open
scott092707 opened this issue Mar 20, 2025 · 2 comments
Labels
bug Not working as intended

Comments

@scott092707
Copy link

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

@scott092707 scott092707 added the bug Not working as intended label Mar 20, 2025
@emersion
Copy link
Member

Can you try again with the latest Sway commit? See https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

@scott092707
Copy link
Author

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 " ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

2 participants