-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Linux: native context menu runs action under mouse when opened #113175
Comments
@thwaller what is almost certainly happening is that the menu is being drawn underneath the mouse cursor and that is activating the menu since the mouse up action triggers the item. we can't prevent that mouse up action from triggering as these are native menus, but we can try to fix the position (we already do try but there seems to be a consistent case you are hitting). if you could reproduce and take a short video, that would be helpful. |
Please see a right click attempt that worked, then one that did not, then one that did in the video. Side note: I was disappointed to see that MKV files cannot be uploaded. EDIT: Before anyone comments, I have no issue with showing the credentials, they are only temp during this process. screen.mp4 |
Interesting. For me, I have tried what you suggest and attached a video of a series of right clicks at different lengths of time pressing the button down. For me, it did not seem to make a difference, it just changed how fast the menu disappeared. Also note that in this video you can see the mouse cursor is not moving, it is just a series of right clicks. screen.mp4 |
@deepak1556 if you get a chance, maybe you could help me with this some time. It seems even with the same coordinates on our side, the menu is sometimes still drawn under the cursor on linux and I am not sure we can do any more about it. |
@sbatten How about always using custom menus, but still allow title bar style to be switched between native and custom? |
Yes, using custom menus does help, but it creates other issues for my workflow. One is that I can no longer hide the title bar, as I currently do with the native one (I'm using Linux/KDE). The other is that the menus are much, much larger, to a point where using them means scrolling through the list of options and this makes the workflow more difficult. I understand some have had this issue years ago as well (I found a github issue opened 4 years ago), but for me personally it only appeared in VSCode 1.53. I reverted back to 1.52 and it's working fine again. It seems to be something related either to the Electron version used in 1.53 or to VSCode itself. For me personally, using the "custom menus" workaround doesn't seem a solution. I would rather prefer this issue is investigated and fixed, as you would normally do with bugs. Thank you. |
I agree with this statement. This issue is "new" for me as well. There was a change somewhere that caused this issue, at least for some of us. |
I have the same issue with VS Code 1.53. And it also works normal in 1.52.
|
For me, this problem happens when I right-click in a central area of my window. If I right-click near an edge, the menu does not spawn under the pointer hot spot. |
I have the same problem on VSCode 1.53.2 on Ubuntu 18.04 64bit My Quickfix solution to use VSCode even thouhg it has the bug, is to not Maybe it could be possible to implement a locking mechanism. |
Same here, Linux Mint 20.1, Firefox 85.0.1, VSCodium 1.53.2. And yes, it started not that long ago, maybe a month or two. Same happens in Parallels on Mac, then same versions of Mint, Firefox and VSCodium. |
I am trying to repro the issue,
Couldn't see the issue with both native and custom context menus. Can anyone provide exact repro steps along with a sample workspace, also please provide the value of |
Do you have some extension that add stuff to the context menu? Like GitLens, Go... |
No, the test was done without any extensions. I have installed gitlens now and still doesn't repro the issue. Can you start with Side note, can you check if the issue repros with |
I tried this and it seems to work fine. I suspect to zoom level now. When I just start code without flags (old setup) and set zoom level back to zero, it behaves better but I will need more time to prove this. |
You need some extensions to add items to your context menus. The issue only appears when the context menu appears under the mouse cursor - you need enough items in the context menu or a screen that is short enough (in height) so that the context menu can't go up or down, avoiding the mouse cursor. |
I am so grateful for all of you reporting on this issue and also for those who are working on this issue and repo. I am on Ubuntu 20.04.1 LTS x86_64 BEFORE (sorry I don't know which release it started happening but it was within the last 2 weeks)What used to happen when I right-click is the menu would appear and then I can left-click to select what I am looking for. AFTERNow what I need to do is right-click and HOLD while I move my cursor off of the pop-up window menu, THEN release right-click, and then I can left-click on the thing that I want to choose. Another option is to hold the right-click down until I have my cursor pointing over the thing that I want to select and then release right-click and it will select that item What I believe is happening is the release of the right-click when a menu is opened is being interpreted as a selection. I believe that before it was opening the menu on "mouse up" from right-click and NOW it is opening the menu on "mouse-down" of right-click and therefore entering selection mode and interpreting "mouse up" as a selection. That's just what I am perceiving and I hope it is helpful. (I find it very unnatural to move my cursor while holding right-click on my laptop) |
After I disabled zoom, it works fine on my laptop (two fingers touch). |
I think this issue is due to VS Code does not work well with high DPI settings. I set my font DPI to 120 so that things are not super tiny on my screen and this issue consistently happens. If I set my font DPI to default then the problem goes away. One would have thought that since Chromium doesn't have this issue, VS Code shouldn't also have it. |
This seems to have worked for me too. |
Great to hear, so it seems to have improved the situation at least for some users. We plan to release a new version this Thursday. |
|
☝ …scratch that above. It still happens. :( For me, it seems that it is more likely to happen when the context menu is drawn on the left side of the cursor (i.e. when the right-click is performed closer to the right edge of the screen/window. I was able to reproduce it on both sides, though. I have now switched to using |
@Igetin did you also set |
Setting |
For me, it still happens with version 1.81.0, but only as @Igetin said, when the menu opens to the left of the mouse cursor (which happens quite often on my laptop monitor). It seems that setting |
In that case, does the menu also need to have enough entries to scroll or in other words open to the top and bottom of the mouse location or is that independent? |
It only happens when the menu has enough entries to open to the top and bottom of the mouse cursor location. If there are less entries and the menu opens only to the bottom, it doesn't happen. |
I have now enabled that setting and tried right-clicking in a bunch of spots. It seems that it now occurs less often, but it still does occur. Unfortunately, that’s not enough for me. I need it to never ever do that. So, for now, if there’s even a small chance of it happening, I cannot use the native context menu and will use the custom one instead. Like @bogdanbeniaminb said, I think it seems to happen when there are a lot of entries in the context menu. For example, in the Git diff view, when right-clicking the right pane. |
I had a chance to check the status of this. I am using VSCode version 1.82.0-insider. The issue appears to be resolved, with no editing of settings required. I have only tested this on a few files, one for sure I know I had open when I reported the issue. My test is by no means comprehensive, but considering this issue happened prior on every right click for me, not seeing it happen at all on multiple files shows a clear change. |
I'm using 1.82.2 on arch linux and the bug is still happening, I'm using a custom DPI set in .Xressources of 144 (1.5x) and bigger fonts set in gtk-${3,4}.0/settings.ini which increase context menus sizes and started to trigger this issue for me. |
@flipflop133 - switching menus from EDIT: 14th Nov - have been running VScode with these settings for 6 weeks now with no right click menu issues |
@itoffshore yeah, thanks I stated in my previous comment in PS3 that it fixed the issue for me, but the issue is not specific to VS Code, it also happened with browser menus (haven't encountered the issue for a while though). |
For some reason @itoffshore's workaroound has stopped working for me. |
@103sbavert - still working ok for me on Arch Linux / XFCE
|
Might be relevant but I am sing VSCodium, altho it happens on the AUR visual-studio-code-bin package as well. here's my settings.json: {
"files.autoSave": "afterDelay",
"window.titleBarStyle": "custom",
"files.autoSaveDelay": 1000,
"editor.fontSize": 13,
"editor.fontFamily": "'JetBrains Mono NL'",
"editor.wordWrapColumn": 150,
"window.restoreWindows": "none",
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.fontSize": 13,
"terminal.integrated.tabs.location": "left",
"terminal.integrated.enablePersistentSessions": false,
"terminal.integrated.persistentSessionReviveProcess": "never",
"security.workspace.trust.untrustedFiles": "open",
"diffEditor.codeLens": true,
"editor.codeLensFontFamily": "'JetBrains Mono NL'",
"window.customTitleBarVisibility": "auto",
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"terminal.external.linuxExec": "kgx",
"terminal.explorerKind": "both",
"window.zoomLevel": 0,
} |
Issue is still present today. It's been happening for years. |
this stackoverflow method work for me, my system is ubuntu 22.04, hope help |
Which comment exactly was it that fixed the issue? |
the top one which install the gesture software
发自我的 iPhone
在 2024年9月3日,23:45,Adrian Delgado ***@***.***> 写道:
https://stackoverflow.com/questions/66419930/the-popup-menu-coming-on-right-click-disappears-instantly-in-vscode
this stackoverflow method work for me, my system is ubuntu 22.04, hope help
Which comment exactly was it that fixed the issue?
—
Reply to this email directly, view it on GitHub<#113175 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A7IEVZLGAA3JGIYQKZ5MAF3ZUXKP7AVCNFSM4VCYXY7KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMZSGY4DKMZVGAYA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
I have experienced a similar problem in my system. The weird fix for me was to enable a compositor like picom or xcompmgr. Then the issue goes away. The even weirder thing to me is that the problem is solved even after I close the compositor. |
Issue Type: Bug
When I right click, the menu will flash on and then off almost immediately, like maybe 100 or 200 milliseconds. This is not all the time, but I am not able to narrow it down. It seems to be only in the editor that this issue exists. I can sometimes "fix" it by right clicking on the left side, like in the Explorer, then going back to the editor. I do not have this issue with any other software on my system. This started maybe Wed this last week, so approx around Dec 16th.
I removed 2 SCSS extensions which I believed were at fault, but with them uninstalled, the problem still exists. Those were my most recently installed extensions, the rest have been there a while.
Regarding what happens, when the right click menu disappears it seems like an option is being selected, almost like there is some sort of double click happening... the first right click to open the menu and a second to select something. I believe this to be the case as different things happen after I right click that normally require me to explicitely call said function.
VS Code version: Code - Insiders 1.53.0-insider (c927a80, 2020-12-18T05:27:50.274Z)
OS version: Linux x64 5.4.0-59-generic
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (68)
The text was updated successfully, but these errors were encountered: