fix: backlight leds subsystem (#2848), sway/ipc reconnect (#3166), ethernet unplug regression (#4364)#5167
Merged
Conversation
The backlight module only enumerated and monitored the udev "backlight" subsystem, so keyboard-backlight LEDs in the "leds" class (e.g. white:kbd_backlight, platform::kbd_backlight) were never discovered and the module fell back to the default when pointed at one. Enumerate and monitor the "leds" subsystem in addition to "backlight". Those LEDs expose the same brightness/max_brightness attributes, so the read path is unchanged. Each device now records its subsystem so the login1 SetBrightness call targets the correct one. Automatic device selection still prefers a "backlight" device and only falls back to a "leds" device when named explicitly or when no screen backlight exists. Fixes #2848.
…ning When sway's event-subscription send buffer overflows during an event flood, sway closes the client connection. The sway IPC event worker (SleeperThread running handleEvent -> recv) then threw on every iteration and the SleeperThread immediately re-invoked it, leaving the sway modules broken while busy-looping on a dead socket and pegging a CPU. Mirror the niri backend's reconnect loop: on a read/EOF/parse error from the event socket, close the old connection, back off for a couple of seconds (so we don't busy-spin), re-open the socket and replay the same subscriptions, then resume. A running_ flag set at the start of teardown makes the worker bail out cleanly instead of reconnecting to a socket that is being closed on purpose. The IPC message protocol and event parsing are unchanged. Fixes #3166.
PR #4190 (merged as 93d85a0) reworked getNetworkState() so the rfkill "disabled" state is evaluated whenever the module has no carrier. Because the module always watches an RFKILL_TYPE_WLAN switch, a wired ethernet module whose cable is unplugged (carrier lost) would return "disabled" instead of "disconnected" whenever the system's WLAN radio happened to be rfkill-blocked. With no format-disabled configured, that state falls back to plain "format", so the interface kept looking connected after unplug. rfkill only concerns wireless radios, so only honor it when there is no interface at all or the current interface is actually wireless (detected via /sys/class/net/<if>/phy80211 or /wireless). A wired interface that lost its carrier now correctly reports "disconnected", while wifi rfkill display from #4190 is preserved. Fixes #4364.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three contained bug fixes from the tracker triage (distinct modules, one commit each).
backlight: keyboard backlights not found (backlight module device option not working as expected #2848) — the backlight module only enumerated/monitored the udev
backlightsubsystem, soleds-class devices (white:kbd_backlight,platform::kbd_backlight) were never discovered. Now matches theledssubsystem too in both the enumeration and the live udev monitor. Automatic device selection still prefers abacklight-subsystem device (aledsdevice only wins when named explicitly or when no screen backlight exists), and the login1SetBrightnessDBus call now passes the selected device's actual subsystem (it previously hardcoded"backlight", which would target the wrong device for an LED). Man pages noted.sway/ipc: no reconnect after disconnect (Waybar freezing and high CPU load when there's lots of window events #3166) — when sway closes the event socket after its send buffer overflows under an event flood,
recvhit EOF and threw; the worker immediately re-invoked it → threw again → tight loop = modules stuck + high CPU. The IPC client now reconnects on disconnect: 2s backoff (kills the CPU spin), re-opens the event socket, replays the subscriptions, and resumes; a shutdown flag lets the worker exit cleanly on teardown. Mirrors the niri backend reconnect.network: ethernet cable-unplug no longer detected (format-disconnected does not work with Ethernet #4364, regression) — PR fix: network module not displaying rfkill state #4190 (rfkill "disabled" state) moved the rfkill check to the top of
getNetworkState(); because the network module always instantiates a WLAN killswitch, a wired ethernet module then reported"disabled"on carrier loss whenever the system's WLAN radio was rfkill-blocked, so a pulled cable looked connected instead ofdisconnected. Now the rfkill-disabled branch is gated on the interface actually being wireless (/sys/class/net/<if>/phy80211), restoring cable-unplug detection while preserving fix: network module not displaying rfkill state #4190's wifi behavior.