Passing NULL to wlr_keyboard_set_keymap results in a segfault.
Example:
Thread 1 "dwl" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e49b64 in xkb_keymap_ref () from /usr/lib/libxkbcommon.so.0
(gdb) bt
#0 0x00007ffff7e49b64 in xkb_keymap_ref () at /usr/lib/libxkbcommon.so.0
#1 0x00007ffff7f06389 in wlr_keyboard_set_keymap () at /usr/lib/libwlroots.so.11
#2 0x000055555555bc54 in createkeyboard ()
#3 0x000055555555c283 in inputdevice ()
#4 0x00007ffff7e8101e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#5 0x00007ffff7e8101e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#6 0x00007ffff7edb52c in () at /usr/lib/libwlroots.so.11
#7 0x00007ffff7ee44b6 in () at /usr/lib/libwlroots.so.11
#8 0x000055555555fe66 in main ()
For some reason brave configured for as a wayland client triggers this code on startup and segfaults.
Checking if the client is mapped fixes this, like with the previous fix for urgent border colour.
References: 887fde65a3
Fixes: 72a7d78a1a
Use an early return to avoid indenting the main logic instead of
wrapping the tail of a function in an if statement.
No functional change, except for a handful of places where printstatus()
was being called spuriously (tag, toggletag, toggleview).
ΔSLOC: 0
The scene graph implementation sends these for us, and it does so more
accurately than our overly-simplified approach. Layer shell surfaces
don't appear to receive these events at all, according to my
WAYLAND_DEBUG experiments with bemenu and dtao.
ΔSLOC: -4
If there is no current drag icon, this node will be empty, but we now
have `drag_icon != NULL` as an invariant. This allows us to eliminate a
conditional, since there's no harm in moving an empty node's coordinates
around with the pointer.
ΔSLOC: -1
If we treat the drag icon as distinct from other layers (it doesn't have
contents that are interactive, focusable, etc.), then we can iterate
over layers meaningfully with a simple for loop.
ΔSLOC: -8
while the size of `int` in most compilers is 32-bits, the size of int and all
other integer types are implementation defined, so make sure we can use up to
32-bits
- Replicate missing functionality from dwl to display the client count in monocle mode
- Add ltsymbol field to Monitor struct
- Display client count in monocle mode when greater than zero
- Tested with somebar and dwlb