Skip to content

notifyicon.go: improve NIN_KEYSELECT handling#140

Merged
dblohm7 merged 1 commit into
mainfrom
aaron/nin_events_mk2
Jul 2, 2026
Merged

notifyicon.go: improve NIN_KEYSELECT handling#140
dblohm7 merged 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
@dblohm7 dblohm7 force-pushed the aaron/nin_events_mk2 branch from b034f59 to 53ec33a Compare June 19, 2026 20:05
Comment thread notifyicon.go Outdated

@nickkhyl nickkhyl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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 6f60e02 to 97351eb Compare July 2, 2026 18:57
@dblohm7 dblohm7 merged commit 28b80ea into main Jul 2, 2026
2 checks passed
@dblohm7 dblohm7 deleted the aaron/nin_events_mk2 branch July 2, 2026 18:58
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.

2 participants