Skip to content

Commit a20a545

Browse files
committed
fix: correct compilation errors in Windows device detector and layout switcher
- Remove unused procSendMessage variable - Fix device variable reference in disconnection callback
1 parent e9b2b98 commit a20a545

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/adapters/devices/windows_device_detector.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

internal/adapters/layouts/windows_layout_switcher.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ func (s *WindowsLayoutSwitcher) activateKeyboardLayout(hkl windows.Handle) error
137137
func (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 (

0 commit comments

Comments
 (0)