djpohly / dwl

dwm for Wayland - ARCHIVE: development has moved to Codeberg
https://codeberg.org/dwl/dwl
Other
1.93k stars 285 forks source link

Line saver: `LISTEN_STATIC` macro #452

Closed djpohly closed 1 year ago

djpohly commented 1 year ago

This parallels the LISTEN macro for statically allocated listeners, and it allows us to remove almost all of the global wl_listener declarations.

This also fixes a bug with the axisnotify listener, which was declared with a compound literal. At block scope, these have automatic storage duration, so the listener was no longer valid after setup() returned. (The option to declare it static explicitly was standardized in C23, if that ever gains suckless traction.)

ΔSLOC: -27

sevz17 commented 1 year ago

Thanks!