Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
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
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.
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_TYPEfixed the problem on Ubuntu 22 with Electron 38.2.0.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
Activity
nikwen commentedon Sep 30, 2025
Thanks for reporting!
electron-issue-triage commentedon Sep 30, 2025
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-reproNeeds 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.
xmedeko commentedon Sep 30, 2025
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.[-]Window chrome buttons are in the left in Ubuntu 22[/-][+]Window chrome buttons are on the left in Ubuntu 22[/+]xmedeko commentedon Sep 30, 2025
Also,
unset XDG_SESSION_TYPEfixes the problem. So, maybe the bug is caused by #48309 ?[-]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[/+]8 remaining items
mitchchn commentedon Oct 8, 2025
@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-layoutand here's what I got::minimize,maximize,closeWhich.. 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.
piotrjurkiewicz commentedon Oct 22, 2025
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:
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.
mitchchn commentedon Oct 22, 2025
@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.
xmedeko commentedon Oct 22, 2025
@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.
nikwen commentedon Oct 23, 2025
@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.
xmedeko commentedon Oct 24, 2025
@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.)
efb4f5ff-1298-471a-8973-3d47447115dc commentedon Oct 24, 2025
@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.
piotrjurkiewicz commentedon Oct 24, 2025
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:
2a. If yes, close the bug.
2b. If not, split it into separate bugs.
efb4f5ff-1298-471a-8973-3d47447115dc commentedon Oct 24, 2025
@piotrjurkiewicz these are all assumptions that you are making.
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.
Thats why you have been asked to file a separate report by @mitchchn otherwise its get lost in the GitHub void.
Its the responsibility of the person who is experiencing a bug to file and maintain it.
nikwen commentedon Oct 24, 2025
@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.
piotrjurkiewicz commentedon Oct 24, 2025
@efb4f5ff-1298-471a-8973-3d47447115dc
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.
xmedeko commentedon Oct 27, 2025
| 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.