May 11th, 2021
mind blown1 reaction

Why does the mouse cursor jump a few pixels if you right-click on the Start button?

Some time ago, I noted that mouse cursor jumps a few pixels if you click on the very bottom row of pixels on the taskbar. I noted that this is done to make it possible to click on the very bottom row of pixels, even though they are technically a border, in order to operate on the button immediately above them. Otherwise, the button-down code sees that the mouse is outside the button and cancels the button operation (click or drag).

If you right-click on the Start button, the mouse cursor jumps a few pixels up and to the right. Is this done to solve the same problem?

No, the problem doesn’t apply here because the right mouse button does not have the same cancellation behavior as the left mouse button. There’s a different reason for moving the mouse cursor.

The mouse cursor moves up and to the right so that it is positioned over the last menu item. That way, you can right-click followed by left-click to activate the bottom menu item.

This means that the bottom item on the Start button’s context menu has a special status: It’s the one you can activate quickly by performing a right-click left-click.

Topics

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

13 comments

Discussion is closed. Login to edit/delete existing comments.

Sort by :
  • Elizabeth GreeneMicrosoft employee

    Neat! It still works in 21h1.

  • GL

    I expected the hack to be bleeding off the edge of screen, like maximized windows. 🤔

  • Neil Rashbrook

    Why right-click and left-click when you can double-right-click? (With a few notable exceptions, you can right-click to activate items in context menus.) Of course I never use my desktop so the whole shortcut is wasted on me.

    What I have noticed recently is that the Alt+Tab popup now* steals activation from the current window, which can be distracting depending on how the current application reacts to losing activation.

    *In Windows 10 compared with Windows XP where it does not; I didn’t bother to research exactly when it changed.

  • Jonathan BarnerMicrosoft employee

    IMO, this is a hack done at the wrong place. A better solution would be to get the start button to really take all the pixels, including the edge/corner ones, and then there wouldn’t be a need to artificially move the mouse. Fun fact: This was actually done in the Windows XP default “Luna” theme, AKA “Fisher-price theme”.

    • Chris Iverson

      The Start button DOES take all the pixels. Try it yourself. You can slam your mouse all the way to the edge, and still be able to click on the button.

      This “hack” is done to position the mouse inside the popup menu that appears when you right-click on the Start menu, which otherwise would not be aligned, simply due to how popup menus work.

      • Jonathan BarnerMicrosoft employee

        You’re right, my complaint only applies to the pre-Windows XP taskbars (or Windows XP with classic theme), which I still remember.