Skip to content

Window chrome buttons are on the left in Electron 38.2.0 on Ubuntu 22 #48422

Closed

Description

@xmedeko

Preflight Checklist

Electron Version

38.2.0

What operating system(s) are you using?

Ubuntu

Operating System Version

22.04

What arch are you using?

x64

Last Known Working Electron version

38.1.2

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

Window chrome buttons respect OS style and settings in Ubuntu Linux. (Like in Ubuntu 24 or older Electron releases, see bellow.) See the screenshot from Ubuntu 22 with the app based on Electron 37

Image

Actual Behavior

When we have upgraded our app to Electron 38.2.0 and window chrome buttons moved to the left while other other Ubuntu 22 apps (including GNOME apps) have the window chrome buttons on the right side.

Image

Furthermore, when I click by right mouse button on the window title bar, context menu appears, that's OK. But since then, the context menu appears for every mouse click does not matter which button. So, left mouse click to window chrome buttons opens context menu - the buttons do not work since then. I cannot even move the window with mouse. I have to restart the app.

Testcase Gist URL

The "Hello World!" app Fiddle creates on start

Additional Information

I have on my Ubuntu 22 GNOME settings:

$ gsettings get org.gnome.desktop.wm.preferences button-layout 
':minimize,maximize,close'
$ echo $XDG_SESSION_TYPE
wayland

Further testing:

  • Ubuntu 22 and Electron 37 or lower: window chrome buttons work well (i.e. like other apps).
  • Ubuntu 24 and Electron 38.2.0: window chrome buttons work well (i.e. like other apps).
  • Ubuntu 22 and Google Chrome 140.0.7339.127: window chrome buttons have a bit different style, but are on the right side and work well.

Update:

  • unset XDG_SESSION_TYPE fixed the problem on Ubuntu 22 with Electron 38.2.0.

Activity

  1. added theissue type on Sep 30, 2025
  2. moved this to 👀 Unsorted Items in 38-x-yon Sep 30, 2025
  3. nikwen commented on Sep 30, 2025

    @nikwen
    Member

    Thanks for reporting!

    1. Would you be able to download Electron Fiddle, use it to create a small sample app that allows maintainers to reproduce this issue, and upload it as a GitHub gist from Fiddle?
    2. With Fiddle, would you be able to go through the different Electron 38 alpha/beta/nightly versions and identify the one that broke this? (You might need to enable nightly versions in the Electron Fiddle settings.)
  4. added
    blocked/need-repro
    on Sep 30, 2025
  5. electron-issue-triage commented on Sep 30, 2025

    @electron-issue-triage

    Hello @xmedeko. Thanks for reporting this and helping to make Electron better!

    Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

    Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

    Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

  6. xmedeko commented on Sep 30, 2025

    @xmedeko
    Author

    Just trying stable builds: 38.1.2 is OK, 38.2.0 has the problem. Should I try other releases?

    Note: I have also setting echo $XDG_SESSION_TYPE -> wayland.

  7. removed
    blocked/need-repro
    on Sep 30, 2025
  8. changed the title [-]Window chrome buttons are in the left in Ubuntu 22[/-] [+]Window chrome buttons are on the left in Ubuntu 22[/+] on Sep 30, 2025
  9. xmedeko commented on Sep 30, 2025

    @xmedeko
    Author

    Also, unset XDG_SESSION_TYPE fixes the problem. So, maybe the bug is caused by #48309 ?

  10. changed the title [-]Window chrome buttons are on the left in Ubuntu 22[/-] [+]Window chrome buttons are on the left in Ubuntu 22 with Electron 38.2.0[/+] on Sep 30, 2025
  11. 8 remaining items

  12. self-assigned this
    on Oct 8, 2025
  13. mitchchn commented on Oct 8, 2025

    @mitchchn
    Member

    @ckerr: yes, on Wayland Electron uses CSD to draw a native titlebar with GTK (electron/src/electron/shell/browser/ui/views/client_frame_view_linux.cc). Part of this code also respects the button layout/order provided by the system.

    I can only repro this bug on Ubuntu, not other distributions on GNOME/Wayland. I recall that once upon a time, Ubuntu had its titlebar buttons left-aligned, so I thought maybe there's something vestigial influencing the outcome. I checked the value of gsettings get org.gnome.desktop.wm.preferences button-layout and here's what I got:

    :minimize,maximize,close

    Which.. seems correct. But then I tried setting it manually anyway: gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

    And doing that fixed the button layout and moved them to the right. 🤷 The buttons stayed that way until I reset the key with gsettings reset org.gnome.desktop.wm.preferences button-layout.

    So at least there's a workaround for users by overriding the gsettings key, but it's really unclear why the key needs to be manually set to the same value that it reports by default.

  14. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 38-x-yon Oct 8, 2025
  15. piotrjurkiewicz commented on Oct 22, 2025

    @piotrjurkiewicz

    I encountered the same bug in Slack after update to version 4.46.101 (Ubuntu 22.04 with the default settings). Changing gsettings indeed moves buttons to the correct side, but other issues remain:

    • After clicking with right mouse button on titlebar, all subsequent clicks (regardless left or right mouse button) open context menu
    • This makes impossible to close/minimize/maximize window or move it
    • This also makes impossible to select any text within the main window with mouse
    • Titlebar font is larger than on X11 and blurred
    • The titlebar itself is thicker
    • Font in menu bar (if enabled) is also larger and blurred

    The first three points were also reported as a part of this issue. Therefore, I don't think this issue should be closed until it is verified that the merged MR fixes not only buttons position, but also the other reported problems.

  16. mitchchn commented on Oct 22, 2025

    @mitchchn
    Member

    @piotrjurkiewicz the frame is drawn very differently from on X11 so it might not look identical. (But please re-test on 38.4, outside of a Fiddle, to confirm if the font/colour differences are still present.

    It will be easier to track issues if they are filed separately as there isn't one single solution for all of them. Please file at least one new bug for appearance (with screenshots from Wayland and X11) and another one for the right-click getting stuck.

  17. xmedeko commented on Oct 22, 2025

    @xmedeko
    Author

    @mitchchn I've reported right-click problems in this issue, see the first post and I've repeated it in the comment: #48422 (comment) I think it belongs here because I've experience it with wrong side of window buttons only. If it's a separate bug, then I do not know how to simulate (if buttons are rendered correctly). So, someone who can simulate it independently should make the separate bug. (Maybe someone who know how to enforce CSD chrome rendering?) BTW. for me it's more serious problem than wrong side of window buttons.

  18. nikwen commented on Oct 23, 2025

    @nikwen
    Member

    @piotrjurkiewicz @xmedeko As Mitch said, if the issues are still there with the merged PR, please open a separate issue. It's hard for us to keep track of issues that mention multiple different symptoms. It's best to create separate issues for every bug you experience.

  19. xmedeko commented on Oct 24, 2025

    @xmedeko
    Author

    @nikwen @mitchchn @piotrjurkiewicz I understand you have plenty issues reported and I thank you for your effort. But you should also understand that we, reporters, do not have deep knowledge of Electron internals. When I've reported this bug, I had no clue about SSD and CSD rendering (and I still do not understand it). From my point of view, all these symptoms had a common root, e.g. a wrong param in a system call, and it would be fixed at once, because all other apps (including Google Chrome) have it right. (And repro is very simple). So, I expected someone with insight would give some hint, like "yes, we change this and it would fix that all" or "this is separate CSD bug create one and try this or that". (Especially when I have stressed that in a separate comment.)

    So, let's stop talking and do the hard work - the context menu bug is still there, see #48656. (I hope I do not need to break it down for every left mouse action. 😜 - Just kidding.)

  20. efb4f5ff-1298-471a-8973-3d47447115dc commented on Oct 24, 2025

    @efb4f5ff-1298-471a-8973-3d47447115dc

    So, stop talking and do the hard work

    @xmedeko
    Being frustrated about a bug is okay but dont take it out on the developers and act entitled. This behavior is very demoralizing to the people that are looking into this and has the oppsite effect of the goal you're trying to reach which is to make this bug go away asap.

    Please refrain from this behavior.

  21. piotrjurkiewicz commented on Oct 24, 2025

    @piotrjurkiewicz

    @piotrjurkiewicz @xmedeko As Mitch said, if the issues are still there with the merged PR, please open a separate issue.

    In my comment I reported that I experienced the same bugs in the latest version of Slack. How I am supposed to incorporate the merged MR into Slack binary to test if it fixes them?

    It should be the task of the maintainer who closed the bug:

    1. Check if the MR solves all reported issues.
      2a. If yes, close the bug.
      2b. If not, split it into separate bugs.
  22. efb4f5ff-1298-471a-8973-3d47447115dc commented on Oct 24, 2025

    @efb4f5ff-1298-471a-8973-3d47447115dc

    It should be the task of the maintainer who closed the bug:

    @piotrjurkiewicz these are all assumptions that you are making.

    1. Check if the MR solves all reported issues.
      2a. If yes, close the bug.

    Incorrect. The responsibility of the maintainers and contributors in regards to a PR are that they link and review issues that directly fixes the initially filled reports. If more reports come in the form of comments they will be looked at but it doesnt mean they will be addressed by that PR.

    It will be easier to track issues if they are filed separately as there isn't one single solution for all of them.

    Thats why you have been asked to file a separate report by @mitchchn otherwise its get lost in the GitHub void.

    2b. If not, split it into separate bugs.

    Its the responsibility of the person who is experiencing a bug to file and maintain it.

  23. nikwen commented on Oct 24, 2025

    @nikwen
    Member

    @xmedeko Thanks for your message! I understand your frustration.

    I didn't want to come across as blaming you when asking you to open a new issue. If I did, I'm sorry for that.

    It's totally understandable that it's not always clear when something should be a separate issue.

    We don't expect that and simply leave a message when it should be split up.

  24. piotrjurkiewicz commented on Oct 24, 2025

    @piotrjurkiewicz

    @efb4f5ff-1298-471a-8973-3d47447115dc

    Incorrect. The responsibility of the maintainers and contributors in regards to a PR are that they link and review issues that directly fixes the initially filled reports. If more reports come in the form of comments they will be looked at but it doesnt mean they will be addressed by that PR.

    The right click issue was also part of the intilially filled bug report. Therefore, as I wrote, it should be checked if it was fixed by the maintainer before closing the bug.

  25. xmedeko commented on Oct 27, 2025

    @xmedeko
    Author

    | So, stop talking and do the hard work

    @efb4f5ff-1298-471a-8973-3d47447115dc It was just a joke, smiley followed. Sorry for my bad English and weird sense of humour. I wanted to say something like "Let's stop talking ..." Lessons learned - do not joke in language you do not know well.

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

Metadata

Metadata

Assignees

Labels

38-x-ybug 🪲component/BrowserWindowhas-repro-gistplatform/linux

Type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions