Skip to content

notifyicon.go: improve NIN_KEYSELECT handling#140

Open
dblohm7 wants to merge 1 commit into
mainfrom
aaron/nin_events_mk2
Open

notifyicon.go: improve NIN_KEYSELECT handling#140
dblohm7 wants to merge 1 commit into
mainfrom
aaron/nin_events_mk2

Conversation

@dblohm7

@dblohm7 dblohm7 commented Jun 19, 2026

Copy link
Copy Markdown
Member

When the keyboard is used to select an icon in the taskbar notification area, Windows sends one or two NIN_KEYSELECT messages depending on which key was used. This second message was confusing walk because it was being interpreted as a request to cancel the menu.

Now, upon encountering the first NIN_KEYSELECT, we set a message-based timer whose duration equals the system's double-click time. If a second NIN_KEYSELECT message is sent before the timer has lapsed, we ignore it. This isn't exactly a great fix, but considering the fragility of sending multiple messages to indicate a particular keypress, it will hopefully suffice.

I'm also tacking on a couple of minor tweaks to application.go.

Updates tailscale/tailscale#17438

@dblohm7 dblohm7 requested a review from nickkhyl June 19, 2026 20:04
When the keyboard is used to select an icon in the taskbar notification
area, Windows sends one or two NIN_KEYSELECT messages depending on which
key was used. This second message was confusing walk because it was
being interpreted as a request to cancel the menu.

Now, upon encountering the first NIN_KEYSELECT, we set a message-based
timer whose duration equals the system's double-click time. If a second
NIN_KEYSELECT message is sent while the timer has yet to lapse, we ignore
it. This isn't exactly a _great_ fix, but considering the fragility of
sending multiple messages to indicate a particular keypress, it will
hopefully suffice.

I'm also tacking on a couple of minor tweaks to application.go.

Updates tailscale/tailscale#17438

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
@dblohm7 dblohm7 force-pushed the aaron/nin_events_mk2 branch from b034f59 to 53ec33a Compare June 19, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant