Rename delay after pressing F2

Resurrecting this thread with more info. I found that after closing Clippy the delay after pressing F2 disappeared. After starting Clippy again there is no delay. It seems Clippy needs to be running for some time for the delay problem to appear.

Clippy is my own FOSS. It's Java but uses Win32 APIs for clipboard monitoring, system-wide hotkey registration, system tray icon, user idle detection, gamma adjustment. It uses a few loops like this:

while (GetMessage(msg, null, WM_CLIPBOARDUPDATE, WM_CLIPBOARDUPDATE)) {
    if (msg.message != WM_CLIPBOARDUPDATE) continue;
    ...

Turns out GetMessage with a filter like this only dequeues the specific message type and leaves everything else sitting in the queue. Eventually the queue fills up (default size 10,000). When Windows sends a broadcast message to all top level windows and one window's queue is saturated, Windows waits a bit for that window to time out. Any action in any software that relies on a broadcast message may not get it until that window first times out.

Indeed I see similar behavior in PDFXchange when pressing alt, there is a delay for the hotkey overlays to appear. It's super annoying because alt+tab shows the overlays before switching apps.

I've fixed my beautiful Clippy to receive all messages and dispatch even those it doesn't care about:

while (GetMessage(msg, null, 0, 0)) {
    if (msg.message != WM_CLIPBOARDUPDATE) {
        TranslateMessage(msg);
        DispatchMessage(msg);
        continue;
    }
    ...

If you have a similar delay problem, some software isn't handling Windows events correctly. Find the app that fixes it when closed, then contact the developer with the above info to fix their stuff.