mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 20:25:39 +02:00
When e.g. a USB soundcard is inserted, we get several CREATE events. In my experiments, we only succeed in connecting to ALSA after the last event. This means, we’ll have several CREATE events that we receive, remove the watcher, attempt to connect, fail, and then re-add the watcher. What if that “last” CREATE event occurs while our watcher has been removed? That’s right, we miss it, and will get stuck waiting forever. The solution is keep the watcher around. Now, if we’ve been successfully connected to ALSA for a long time, chances are we’ve built up events (for other cards, for example). We don’t want to trigger a storm of re-connect attempts, so drain the event queue after having been disconnected from ALSA. There *is* a small race here - if a card is removed and re-added *very* fast, we _may_ accidentally drain the CREATE event. I don’t see this happening in reality though. |
||
---|---|---|
.. | ||
alsa.c | ||
backlight.c | ||
battery.c | ||
clock.c | ||
i3-common.c | ||
i3-common.h | ||
i3-ipc.h | ||
i3.c | ||
label.c | ||
meson.build | ||
mpd.c | ||
network.c | ||
removables.c | ||
river.c | ||
script.c | ||
sway-xkb.c | ||
xkb.c | ||
xwindow.c |