xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

Put a cap on window names #810

Closed geekosaur closed 1 year ago

geekosaur commented 1 year ago

Description

It turns out qutebrowser will place an entire data: URL in _NET_WM_NAME, up to at least 389K characters including newlines and possibly binary characters.

Clamping window titles to the first line, and to 2K chars because defaultShrinker is quadratic in the title length.

Closes #809

Checklist

geekosaur commented 1 year ago
[19 15:36:26] <L29Ah> hmm xmonad hangs for a few secs even with this patch
[19 15:36:50] <L29Ah> but that's good enough i guess
[19 15:44:27] <geekosaur> seemed pretty quick here
[19 15:45:21] <L29Ah> i7-8550U laptop here
[19 15:45:35] <geekosaur> mine is an older i5
[19 15:45:50] <geekosaur> and I'm running it in a xephyr in a test harness
[19 15:47:57] <L29Ah> i guess that might be due to the fact i have several such tabs in my qutebrowser
[19 15:48:09] <L29Ah> and it blinks them
[19 16:06:42] <geekosaur> what I'm actually seeing is qutebrowser hangs for a second or two. that's not under xmonad's control; drawing is solely between the client and the X server, xmonad can't even know it's happening without e.g. taking a couple of screenshots and comparing them