File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,10 @@ func (d *WindowsDeviceDetector) pollDevices(ctx context.Context) {
141141 }
142142
143143 // Check for removed devices (disconnected)
144- for id , device := range previousDevices {
144+ for id := range previousDevices {
145145 if _ , exists := currentDevices [id ]; ! exists {
146146 // Device was disconnected - use the stored device info
147+ device := previousDevices [id ]
147148 if d .onDisconnectedCallback != nil {
148149 // Run callback in goroutine to avoid blocking polling
149150 go func (dev * domain.Device ) {
@@ -153,7 +154,7 @@ func (d *WindowsDeviceDetector) pollDevices(ctx context.Context) {
153154 }
154155 }()
155156 d .onDisconnectedCallback (dev )
156- }(dev )
157+ }(device )
157158 }
158159 }
159160 }
Original file line number Diff line number Diff line change @@ -137,7 +137,6 @@ func (s *WindowsLayoutSwitcher) activateKeyboardLayout(hkl windows.Handle) error
137137func (s * WindowsLayoutSwitcher ) broadcastLayoutChange (hkl windows.Handle ) error {
138138 user32 := windows .NewLazySystemDLL ("user32.dll" )
139139 procPostMessage := user32 .NewProc ("PostMessageW" )
140- procSendMessage := user32 .NewProc ("SendMessageW" )
141140
142141 // Windows messages
143142 const (
You can’t perform that action at this time.
0 commit comments