Release 3.8.2.6: perceived-speed UX — search, tray hide, core warm, SSE.
Server search/hotkeys; Windows close-to-tray; background EnsureCore; SSE status with rare poll fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -47,9 +47,11 @@ const (
|
||||
tpmRight = 0x0020
|
||||
tpmBottom = 0x0020
|
||||
idiApplication = 32512
|
||||
idOpen = 1000
|
||||
idConnect = 1001
|
||||
idDisconnect = 1002
|
||||
idQuit = 1003
|
||||
wmLButtonDblClk = 0x0203
|
||||
)
|
||||
|
||||
type notifyIconData struct {
|
||||
@@ -107,12 +109,21 @@ func runTray(appName string, h Hooks) {
|
||||
var wndProc = windows.NewCallback(func(hwnd windows.Handle, msgU uint32, wParam, lParam uintptr) uintptr {
|
||||
switch msgU {
|
||||
case wmTray:
|
||||
if lParam == wmRButtonUp || lParam == wmLButtonUp {
|
||||
switch lParam {
|
||||
case wmLButtonDblClk:
|
||||
if h.Show != nil {
|
||||
go h.Show()
|
||||
}
|
||||
case wmRButtonUp, wmLButtonUp:
|
||||
showMenu(hwnd, h)
|
||||
}
|
||||
return 0
|
||||
case wmCommand:
|
||||
switch int(wParam & 0xffff) {
|
||||
case idOpen:
|
||||
if h.Show != nil {
|
||||
go h.Show()
|
||||
}
|
||||
case idConnect:
|
||||
if h.Connect != nil {
|
||||
go h.Connect()
|
||||
@@ -178,6 +189,10 @@ func showMenu(hwnd windows.Handle, h Hooks) {
|
||||
p, _ := windows.UTF16PtrFromString(text)
|
||||
procAppendMenu.Call(menu, mfString, uintptr(id), uintptr(unsafe.Pointer(p)))
|
||||
}
|
||||
if h.Show != nil {
|
||||
add(idOpen, "Открыть")
|
||||
procAppendMenu.Call(menu, mfSeparator, 0, 0)
|
||||
}
|
||||
up := h.IsUp != nil && h.IsUp()
|
||||
if up {
|
||||
add(idDisconnect, "Отключить")
|
||||
|
||||
Reference in New Issue
Block a user