Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve context view placement around box #57399

Closed
joaomoreno opened this issue Aug 28, 2018 · 6 comments
Closed

Improve context view placement around box #57399

joaomoreno opened this issue Aug 28, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@joaomoreno
Copy link
Member

joaomoreno commented Aug 28, 2018

On Linux.

If I open the editor context menu in a small enough window, the action right below the mouse cursor will be executed instantly, since the change that makes an action run on mouse up. We should nudge the menu 1px to the side (to the right when on the right side, to the left when on the left) in order not to have the menu right below the mouse cursor.

It doesn't repro if the window is large enough since the menu will be 1px nudged down in that case.

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority workbench-menu labels Aug 28, 2018
@sbatten sbatten added this to the August 2018 milestone Aug 30, 2018
@sbatten
Copy link
Member

sbatten commented Aug 30, 2018

@joaomoreno sorry, I can't repro this on windows and I don't have access to my Linux VMs while traveling. Also, could you point me to where the nudging down happens so I can add left and right? I was looking in contextview.ts but didn't find it.

@joaomoreno
Copy link
Member Author

The nudging happens here: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/contextmenu/contextmenu.ts#L99

This appears to be a bad place to do it, since it only affects editor context menus. I was able to fix my problem by adding 2 to the x coordinate, 1 was not enough. But other menus around the workbench still suffer from the same problem, e.g. explorer.

@bpasero bpasero added the candidate Issue identified as probable candidate for fixing in the next release label Aug 30, 2018
@bpasero
Copy link
Member

bpasero commented Aug 30, 2018

This seems to not be a problem on Windows where the menu does not seem to open on mouse down.

@bpasero
Copy link
Member

bpasero commented Aug 30, 2018

@sbatten PR up at #57614

@bpasero bpasero modified the milestones: August 2018, September 2018 Aug 31, 2018
@bpasero bpasero removed the candidate Issue identified as probable candidate for fixing in the next release label Aug 31, 2018
@bpasero
Copy link
Member

bpasero commented Aug 31, 2018

Talking with @joaomoreno, needs support from the context view component.

@tianbis
Copy link

tianbis commented Sep 6, 2018

Can confirm. If I right-click to open the context menu and the cursor ends up somewhere in the middle of the menu, the action under the cursor gets executed. I can avoid this if I keep the mouse button down, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
4 participants