Repository navigation
fix: position window titlebar buttons correctly in Ubuntu on Wayland - #48490
Conversation
|
@mitchchn could you please add release notes? You also need to sign your commit :) |
|
Done and done! Apologies for the force push, I did not realize my commit signing hadn't been set up properly on Linux. |
|
One more thing for future readers: Vanilla GNOME does not have tray icon/appindicator support. This is true both before and after this change. (No tray icons in Fedora out of the box for example.) If your distribution does not include a shell extension for GNOME appindicators, you need to install one to see tray icons. Forcing "Unity" will have no effect on modern Linux distributions. |
VerteDinde
left a comment
There was a problem hiding this comment.
Thanks for digging into this and for such a detailed write up, @mitchchn!
|
Did a search of Chromium and Electron for everywhere that
There are a handful of
There is one instance where the behavior of Unity significantly overlaps with GNOME:
There are a few instances where the use of Unity and/or GNOME are insignificant in Electron:
There were a few places that I found clones of Chromium code in Electron:
Finally, there are some instances where there is a meaningful difference in behavior:
|
There was a problem hiding this comment.
From the analysis, I think there are only three things I'm concerned about:
- The global accelerator listener being disabled due to a bug in GNOME. (Admittedly, this isn't an issue in current stable releases, but may be in an upcoming or most recent nightly.)
- Our copy of
chrome_views_delegate_linux.ccthat may change titlebar behavior. - Knowing what the existing behavior of our Unity service is and what it will be after this change. There's a handful of Electron code depending on this old service. It's not gated on
XDG_CURRENT_DESKTOP=Unitybut I want to rule out any other interference too.
I'd like to rule out any blockers in those three areas ahead of landing this if we can! 😄 I haven't tested or poked at anything, just flagging some concerns to discuss.
|
Thanks for the analysis @clavin! I don't know the answers to these questions 100%, but for what it's worth:
I tested global shortcuts in this branch and they work for me on GNOME and KDE in X11 and Wayland (although it's a bit clunky in KDE on Wayland). Global shortcuts have been a rocky area for Wayland in general, so there might be current issues or future regressions but I do not believe it would help at all to pretend to be Unity.
I tested on GNOME/Wayland, GNOME/X11, KDE/Wayland and KDE/X11 with maximized and un-maximized windows with no apparent titlebar issues. Not sure how to exercise the Unity service or anything that uses |
clavin
left a comment
There was a problem hiding this comment.
In that case, I think we are good to land this. Thanks for looking into this! 😁👍
|
@mitchchn, could you rebase on |
Our README says that supported Ubuntu versions are 18.04 and higher. 18.04 was the first version to not use Unity. |
|
Removing target/37-x-y as it fixes an issue introduced in v38. |
|
@mitchchn is this ready for final review? I see you closed and reopened it. |
|
@codebytere yep, closed it accidentally. |
|
Release Notes Persisted
|
…48490) Co-authored-by: Mitchell Cohen <[email protected]>
…48490) Co-authored-by: Mitchell Cohen <[email protected]>
|
I have automatically backported this PR to "38-x-y", please check out #48602 |
|
I have automatically backported this PR to "39-x-y", please check out #48603 |
…48603) fix: position window titlebar buttons correctly in Ubuntu on Wayland (#48490) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Mitchell Cohen <[email protected]>
…48602) fix: position window titlebar buttons correctly in Ubuntu on Wayland (#48490) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Mitchell Cohen <[email protected]>
Description of Change
Fixes #48422.
The CSD-drawn titlebar buttons were drawn as leading (left-aligned) when running on Wayland in Ubuntu. This happened because:
XDG_CURRENT_DESKTOP=Unity) to work around decade-old tray icon issues (Elementary OS tray icon / indicator missing - again #5050)My solution to fix the icon alignment is to remove the old workaround code that emulates Unity. Unity is an unsupported desktop environment that has not been included in Ubuntu since 2018. An app claiming to be running on Unity when it isn't will cause much more harm than good on modern Linux. (See: #45310.)
Tray icons on Linux (appindicators) also do not depend on the Unity workaround anymore as you can see in the screenshot. It is possible but unlikely that users of very old (obsolete) or unusually configured distributions might lose their tray icons as a result of this fix, but they can always set the XDG_CURRENT_DESKTOP variable manually if they choose. Electron should not be overriding it in any event.
Checklist
npm testpassesRelease Notes
Notes: Titlebar buttons now appear on the correct side of windows on Wayland in Ubuntu