From Thiago Kenji Okada to ~emersion/public-inbox
This patch improves the reliability of my setup, where I have a Dell monitor that also acts as a KVM (so if I switch the input, it also switches the plugged USB devices to that input). Before I had to restart kanshi.service after sleep in swayidle, otherwise I would get a black screen almost half of the time (that I assume is because kanshi would see no monitors after waking up from sleep). With this patch I can put my device to sleep, switch inputs, get back and see kanshi setting the proper screen/refresh rate 100% of the time, while before sometimes I would get my monitor set to 60Hz (the default, but not what I configured in kanshi), because I assume kanshi would not get the unplug/plug event reliably. Or maybe it got one, but the monitor was still "disconnected", because this laptop is in a dock that supplies DisplayPort/HDMI via its USB-C connector and this itself takes a while to initialize after sleep (something like 2 seconds).