Skip to content

Context menu gets too small depending on the cursor position #224515

Open

Description

@kapodamy

Type: Bug

Context menus style has changed with lastest vscode version and they are not the right size.
Edit: issued by chrome which changed the sytle of the menus, explained here electron/electron#42262
Edit 17/april/2025: the upstream was Closed as not planned.

VS Code version: Code 1.92.0 (b1c0a14, 2024-07-31T23:26:45.634Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
Screen Size 1366x768

version:
new

previous:
old

Steps to Reproduce:

  • Open context menu

workarround here #224515 (comment) (requires restart)

Activity

  1. Scorg commented on Aug 2, 2024

    @Scorg

    I have a similar problem, but also with fonts being bold:
    ttt

  2. lah7 commented on Aug 2, 2024

    @lah7

    I was going to open a report too. I couldn't find any mention in the release notes, or any setting, so I think it could be related to the Electron 30 upgrade.

    Using Arch Linux / KDE with a 2160p monitor here (2.0 global scale). Context menus are way too padded and large here too.

    1.91.1 1.92.0
    Editor - Before Editor - After
    Explorer - Before Explorer - After (I admit the newer menu does position better horizontally to the left)

    Looks like the new menu goes either all above or all below the cursor position, hence the scrolling.

    Would really love to see an option for the old (native?) menus back. If that's impossible, at least add customisation options to control the padding, font, colours to make the new menu more comfortable.

  3. medovina commented on Aug 2, 2024

    @medovina

    I'm using Ubuntu 24.04. With this VS Code release the context menu font is uncomfortably large on my machine as well. I'd also like to have an option to use the old menu style.

    I think the title of this issue (currently "Context menu gets too small depending on the cursor position") should be more general, e.g. "Context menu has inappropriate font size".

  4. godoyLeonardo commented on Aug 3, 2024

    @godoyLeonardo

    I'm using Ubuntu 24.04. With this VS Code release the context menu font is uncomfortably large on my machine as well. I'd also like to have an option to use the old menu style.

    I think the title of this issue (currently "Context menu gets too small depending on the cursor position") should be more general, e.g. "Context menu has inappropriate font size".

    inappropriate font size and padding

  5. chapmanjacobd commented on Aug 3, 2024

    @chapmanjacobd

    It seems like the new context menu loads a 100~200 ms slower too

  6. Vallek commented on Aug 3, 2024

    @Vallek

    Please give us an option to revert it! I don't need or want tablet style menus in a desktop code editor)

  7. halfburnttoast commented on Aug 3, 2024

    @halfburnttoast

    Also having this problem with Linux Mint MATE 21.3. The menu items are way too large. The context menu is so large that the items can't fit on the screen. I've downgraded back to 1.91 for now.

    codeissue1
    codeissue2

  8. CGooden9 commented on Aug 4, 2024

    @CGooden9

    Same here. Also, the menu is bright white for me, despite using the dark modern theme. Maybe that's because I'm using the mixed Linux Mint theme (most parts are white, some are black for contrast)? I feel that it should at least match up with the app theme, like the old one did (or have an option to revert back to the old version altogether).
    Screenshot from 2024-08-03 18-52-17

  9. CGooden9 commented on Aug 4, 2024

    @CGooden9

    I've figured out a temporary solution, at least on linux. Set window.titleBarStyle to "custom". This restores the context menus, though also changes other parts of the UI. I've attached some screenshots for comparison.
    Screenshot from 2024-08-03 19-46-05
    Screenshot from 2024-08-03 19-49-25

  10. kapodamy commented on Aug 4, 2024

    @kapodamy
    ContributorAuthor

    upstream problem electron/electron#42262

  11. GaryMatthews commented on Aug 5, 2024

    @GaryMatthews

    cheers CGooden9 this is exactly the fix i was looking for to solve the context menu font size issue. now its a matter of excess padding but this puts most if not all menu items back into view instead of having to scroll to menu items on wasted screen real estate which is a frustrating experience.

  12. akalankasakalasooriya commented on Aug 7, 2024

    @akalankasakalasooriya

    Same happened to me on ubuntu 22.04. KDE plasma
    #225033

  13. 26 remaining items

  14. jamesrobb commented on Oct 14, 2024

    @jamesrobb

    Running into this with Manjaro, Plasma 6.1.5, VSCode 1.94.1

  15. elamperti commented on Dec 14, 2024

    @elamperti

    Same issue here — Manjaro, i3wm, VSCode v1.96

    Enabling the custom window style solves the context menu but fucks up the title bar, since it tries to use the vscode title bar implementation (which takes a gigantic chunk of precious vertical space).

  16. lah7 commented on Dec 16, 2024

    @lah7

    💡 Tip for Linux KDE/KWin (X11) users: You can force the native title bar with a custom title bar style (the workaround to fix menus as mentioned) by adding a window rule like so:

    • System Settings → Window Management → Window Rules → New
      • Window class (application) : code Code
      • Add: "No titlebar and frame" : "Apply Initially" = "No"
        Image

    Optionally, use the Custom CSS JS Loader extension to hide the application icon in the menu bar with CSS:

    .window-appicon {
        display: none;
    }

    End result:
    Image

    Although, this may not be useful if you want the title bar and tab bar only. This is like having a menu bar & poor man's toolbar (#41309) stitched together above the tabs. There's also double window controls until #229385 is merged (thanks Rob Rolls (@tycode) for working on that!). For me, the native title bar is important as it's my middle click shortcut to lower windows.

    I actually prefer VS Code's custom menus over the "native" ones the earlier versions had - that's probably because VS Code's menus have an empty icon column, even though VS Code doesn't populate them (#208482), this menu layout/spacing is more in line with the rest of the system.

    I'm not sure if the other window compositing managers (marco, metacity, openbox, i3) have this ability if you wanted to use this workaround.

  17. glitterkitty commented on Jan 14, 2025

    @glitterkitty

    I've figured out a temporary solution, at least on linux. Set window.titleBarStyle to "custom". This restores the context menus, though also changes other parts of the UI.

    #224515 (comment)

    thx CGooden9
    worked for me, too

  18. 0009-0009-1013-986X commented on Feb 28, 2025

    @0009-0009-1013-986X

    Tip for KWin users

    1

    Luke Horwell (@lah7), are you using XOrg 11? I believe it'll only work for that and XWayland, per bugs.kde.org/show_bug.cgi?id=452240.

    Footnotes

    1. #issuecomment-2545724749 ↩

  19. lah7 commented on Feb 28, 2025

    @lah7

    @RokeJulianLockhart Yes, I'm using X11. Thanks for the info. I've updated my previous comment.

    A plus for the custom menus is that they can be recoloured to blend in with the rest of the system:

    {
        "workbench.colorCustomizations": {
            // Colours for KDE Breeze
            "menu.background": "#25282c",
            "menu.foreground": "#eaebef",
            "menu.selectionBorder": "#47a8d9",
            "menu.selectionBackground": "#2f5469",
            "menu.selectionForeground": "#eaebef",
            "menu.separatorBackground": "#55585b",
        }
    }

    Electron (upstream) made their position clear that they won't diverge from Chromium to bring back the old menus. Chromium (their upstream) will need to bring them back.... but I have some doubts.

    I believe these PRs can be a way forward for VS Code - avoid Chromium's so-called "native" menus and have VS Code split their configuration (as Rob Rolls (@tycode) proposed) so native window title bars are not tied under native ugly Chromium menus. It seems that Electron for macOS is only one that truly uses the OS' "native" menu.

  20. oc109 commented on Jun 1, 2025

    @oc109

    With the insider update (#245423) users can set "Window: Menu Style" separately apart from "Window: Title Bar Style".

    Here is the ideal result, native title bar and custom menu:

    Image

  21. flying-sheep commented on Jun 3, 2025

    @flying-sheep
    Contributor

    Both menu styles are custom on Linux. Ideally, Electron would allow using an actually native menu on Linux.

    But for the purpose of this issue (wrongly sized menu) I guess this fixes it!

  22. 0009-0009-1013-986X commented on Jun 3, 2025

    @0009-0009-1013-986X

    Both menu styles are custom on Linux. Ideally, Electron would allow using an actually native menu on Linux.

    Philipp A. (@flying-sheep), "native" doesn't mean much here. Do you mean that VSC should implement a Qt 6 and GTK 4 context menu? Chromium has integrations with both toolkits (although its Qt 5 or 6 integration is dreadful, and the GTK 3 one is substandard too), but I believe that that's specific to the browser's GUI, rather than something provided with the engine itself. I don't see that occurring without a separate issue filed for it, and I don't think it would be in scope for upstream Electron.

  23. ra50 commented on Jun 13, 2025

    @ra50

    With the insider update (#245423) users can set "Window: Menu Style" separately apart from "Window: Title Bar Style".

    Here is the ideal result, native title bar and custom menu:

    Image

    There's a bug with this update. With Title Bar Style set to native and Menu Style set to custom (the setting you need to get normal sized menus), the Menu Bar Visibility setting of "classic" no longer works - no matter what you pick, the menu doesn't show, even with Alt.

  24. tycode commented on Jun 13, 2025

    @tycode

    There's a bug with this update. With Title Bar Style set to native and Menu Style set to custom (the setting you need to get normal sized menus), the Menu Bar Visibility setting of "classic" no longer works - no matter what you pick, the menu doesn't show, even with Alt.

    I tested this last night (see #251113 (comment)) and it looks fine to me:

    Image

    with the following version: (which I guess is now one day out of date)

    Version: 1.102.0-insider
    Commit: 8ece07a
    Date: 2025-06-12T05:05:34.387Z
    Electron: 35.5.1
    ElectronBuildId: 11727614
    Chromium: 134.0.6998.205
    Node.js: 22.15.1
    V8: 13.4.114.21-electron.0
    OS: Linux x64 6.1.0-37-amd64

    and settings.json:

    {
        "window.titleBarStyle": "native",
        "window.menuStyle": "custom",
        "workbench.navigationControl.enabled": false,
        "window.commandCenter": false,
        "chat.commandCenter.enabled": false,
        "workbench.layoutControl.enabled": false
    }

    (Menu Bar Visibility is at its default of "classic")

    If there's a new bug (maybe a newly introduced regression?) then probably better to open a new issue for it, with full repro steps.

  25. ra50 commented on Jun 13, 2025

    @ra50

    There's a bug with this update. With Title Bar Style set to native and Menu Style set to custom (the setting you need to get normal sized menus), the Menu Bar Visibility setting of "classic" no longer works - no matter what you pick, the menu doesn't show, even with Alt.

    I tested this last night (see #251113 (comment)) and it looks fine to me:

    Image

    with the following version: (which I guess is now one day out of date)

    Version: 1.102.0-insider
    Commit: 8ece07a
    Date: 2025-06-12T05:05:34.387Z
    Electron: 35.5.1
    ElectronBuildId: 11727614
    Chromium: 134.0.6998.205
    Node.js: 22.15.1
    V8: 13.4.114.21-electron.0
    OS: Linux x64 6.1.0-37-amd64

    and settings.json:

    {
    "window.titleBarStyle": "native",
    "window.menuStyle": "custom",
    "workbench.navigationControl.enabled": false,
    "window.commandCenter": false,
    "chat.commandCenter.enabled": false,
    "workbench.layoutControl.enabled": false
    }

    (Menu Bar Visibility is at its default of "classic")

    If there's a new bug (maybe a newly introduced regression?) then probably better to open a new issue for it, with full repro steps.

    Thanks for this, toggling window.commandCenter on and back off made the menu appear. Must've just been a side effect of the exact order of enabling things.

  26. oc109 commented on Jul 10, 2025

    @oc109

    There's a bug with this update. With Title Bar Style set to native and Menu Style set to custom (the setting you need to get normal sized menus), the Menu Bar Visibility setting of "classic" no longer works - no matter what you pick, the menu doesn't show, even with Alt.

    As you can see I use the compact menu bar to avoid it.

  27. tycode commented on Jul 15, 2025

    @tycode

    Thanks for this, toggling window.commandCenter on and back off made the menu appear. Must've just been a side effect of the exact order of enabling things.

    Having now updated 1 Linux PC and 3 Windows PCs to VS Code Stable 1.102 myself, I had this issue on one of the Windows PCs, and the same fix worked: toggling window.commandCenter on and back off. The other three PCs had no problem.

    oc109 does this fix work for you?

  28. 0009-0009-1013-986X commented on Jul 16, 2025

    @0009-0009-1013-986X

    #224515 (comment)

    Rob Rolls (@tycode), since multiple people have experienced this, I suggest someone affected file an issue about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

electronmenusupstream-issue-linked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions