mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 12:15:22 +01:00
[GH-ISSUE #866] sway: bar panics when changing keyboard layout #8693
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#8693
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @quietvoid on GitHub (Feb 8, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/866
Describe the bug
When changing the keyboard layout, the bar panics. The layout does seem to change though.
I haven't looked much into it since it seems to fail at the channel send.
To Reproduce
ironbarwithkeyboardtype widget and run.ironbarpanicsBacktrace: ironbar.log
Expected behavior
The bar should keep working.
System information:
75375aa341Configuration
Config
@quietvoid commented on GitHub (Feb 16, 2025):
Tried testing with
IRONBAR_LOG=trace IRONBAR_FILE_LOG=traceand for some reason adding the file trace logging makes the events work fine.There might be a race condition somewhere.
Log: trace.txt
@JakeStanger commented on GitHub (Feb 16, 2025):
I did update the sway IPC crate yesterday. I assume it's still broken according to the regular repro steps?
Seems it doesn't occur when you run sway inside another compositor. I've not had a chance to boot into sway to repro myself yet.
@quietvoid commented on GitHub (Feb 16, 2025):
Yes, it is still broken on the latest commit.
I think there are duplicate events being sent somehow according to the logs, some of them aren't even from Keyboard input devices.
@quietvoid commented on GitHub (Feb 16, 2025):
From what I can tell the receiver is being dropped somewhere, randomly.
I think what I'm running into is that more than 4 events are received in one layout change, making the channel full.
Which then returns an error: https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Receiver.html#method.recv
And the loop looks like this:
Therefore the controller for
KeyboardLayoutClientis silently dropping it.@quietvoid commented on GitHub (Feb 16, 2025):
I suppose the easy solution would be to just increase the channel capacity.
Though I don't know if there's a good reason every module loop is like that.
It might be better to just loop infinitely, ignoring receiver errors.
@JakeStanger commented on GitHub (Feb 16, 2025):
I reckon both is probably the right call. If the buffer is filling up, it should be increased to be able to handle capacity.
Elsewhere I am looping and handling lag errors explicitly, so could do the same here if it's likely to be a recurring issue.
https://github.com/JakeStanger/ironbar/blob/master/src%2Fmacros.rs#L115
Ideally it should just throw an error and break in worst case scenarios too, rather than panicking and crashing the whole bar.