Ariver
2026-06-02 3fbceec8de833416bf1ae049f959f222c3f1a4a0
privatevoice.src/internal/overlay/overlay_windows.go
File was renamed from VoiceSnapGo/internal/overlay/overlay_windows.go
@@ -96,18 +96,18 @@
   pt      wPoint
}
type wWndClassEx struct {
   cbSize      uint32
   style       uint32
   wndProc     uintptr
   clsExtra    int32
   wndExtra    int32
   hInstance   uintptr
   hIcon       uintptr
   hCursor     uintptr
   hbrBg       uintptr
   menuName    *uint16
   className   *uint16
   hIconSm     uintptr
   cbSize    uint32
   style     uint32
   wndProc   uintptr
   clsExtra  int32
   wndExtra  int32
   hInstance uintptr
   hIcon     uintptr
   hCursor   uintptr
   hbrBg     uintptr
   menuName  *uint16
   className *uint16
   hIconSm   uintptr
}
type gdipSI struct {
   ver      uint32
@@ -300,13 +300,34 @@
func (o *winOverlay) SetVolume(vol float64)           { trySendF(o.volCh, vol) }
func (o *winOverlay) SetPosition(x, y int)            { trySendP(o.posCh, [2]int{x, y}) }
func (o *winOverlay) GetPosition() (int, int)         { return o.posX, o.posY }
func (o *winOverlay) Size() (int, int)                { return capW, capH }
func (o *winOverlay) OnDragged(fn func(x, y int))     { o.dragCb = fn }
func (o *winOverlay) Close()                          { close(o.closeCh); <-o.done }
func trySend(ch chan bool, v bool)          { select { case ch <- v: default: } }
func trySendS(ch chan statusCmd, v statusCmd) { select { case ch <- v: default: } }
func trySendF(ch chan float64, v float64)   { select { case ch <- v: default: } }
func trySendP(ch chan [2]int, v [2]int)     { select { case ch <- v: default: } }
func trySend(ch chan bool, v bool) {
   select {
   case ch <- v:
   default:
   }
}
func trySendS(ch chan statusCmd, v statusCmd) {
   select {
   case ch <- v:
   default:
   }
}
func trySendF(ch chan float64, v float64) {
   select {
   case ch <- v:
   default:
   }
}
func trySendP(ch chan [2]int, v [2]int) {
   select {
   case ch <- v:
   default:
   }
}
// ---- Main render thread ----
@@ -336,7 +357,7 @@
   // Register window class
   hInst, _, _ := kGetModuleHandle.Call(0)
   cls, _ := syscall.UTF16PtrFromString("VoiceSnapOverlay")
   cls, _ := syscall.UTF16PtrFromString("PrivateVoiceInputOverlay")
   wc := wWndClassEx{
      cbSize:    uint32(unsafe.Sizeof(wWndClassEx{})),
      wndProc:   syscall.NewCallback(overlayWndProc),