Skip to content

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

Open
@scott092707

Description

@scott092707

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions