Skip to content

feat: respect linux wco button order - #51010

Closed
tarik02 wants to merge 1 commit into
electron:mainfrom
tarik02:feat/linux-wco-button-order
Closed

tarik02 wants to merge 1 commit into
electron:mainfrom
tarik02:feat/linux-wco-button-order

Conversation

@tarik02

@tarik02 tarik02 commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Description of Change

Closes #51000

All code changes and understanding were manually done by me. OpenAI Codex assistance was used only for setting up build environment and searching/exploring mostly chromium codebase.

@codebytere sorry for previous slop MRs. This is my last attempt :). Now everything made manually by me.

Before/after this change:
image

Here is gist with app code used in screenshot: https://gist.github.com/tarik02/0a3276b19fa0d9912faa039aef8507ee

Checklist

Release Notes

Notes: WCO respected the title bar order defined in system settings.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 13, 2026
@tarik02
tarik02 force-pushed the feat/linux-wco-button-order branch from 923de31 to 4229a8e Compare April 16, 2026 06:03
@tarik02

tarik02 commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

@mitchchn you may be interested, can you please review?

@mitchchn

mitchchn commented Apr 16, 2026 •

Copy link
Copy Markdown
Member

cc @aiddya whose new Chromium patch also supports this (I believe): #50707

@mlaurencin mlaurencin added semver/minor backwards-compatible functionality target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Apr 16, 2026
@aiddya

aiddya commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

Yes, #51161 addresses this issue.

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 20, 2026
ckerr
ckerr previously requested changes Apr 27, 2026

@ckerr ckerr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a linter fix. yarn run lint:cpp should fix it; otherwise, https://github.com/electron/electron/actions/runs/24494864746/job/71702543542?pr=51010 has a list of what needs to change

@tarik02
tarik02 force-pushed the feat/linux-wco-button-order branch from 4229a8e to 8c2b190 Compare April 28, 2026 08:04
@tarik02

tarik02 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

@ckerr done


caption_button_placeholder_container_ =
if (auto* linux_ui = ui::LinuxUi::instance())
linux_ui->AddWindowButtonOrderObserver(this);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this technically works, maintaining a base::ScopedObservation member at the class-level is safer and idiomatic.

@tarik02 tarik02 Apr 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@tarik02
tarik02 force-pushed the feat/linux-wco-button-order branch from 8c2b190 to 1d7c60f Compare April 29, 2026 07:07
@ckerr
ckerr dismissed their stale review April 30, 2026 17:49

stale

@ckerr
ckerr requested review from aiddya and ckerr April 30, 2026 17:49
leading_button_placeholder_container_;
raw_ptr<CaptionButtonPlaceholderContainer>
trailing_button_placeholder_container_;
base::ScopedObservation<ui::LinuxUi, ui::WindowButtonOrderObserver>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this? You seem to be missing an include here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, sorry, didn't
now updated, ran build&lint + manually tested

@tarik02
tarik02 force-pushed the feat/linux-wco-button-order branch from 1d7c60f to 8e5c1e1 Compare May 1, 2026 17:50
@tarik02

tarik02 commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebased and fixed lint

@aiddya

aiddya commented May 2, 2026

Copy link
Copy Markdown
Contributor

Looks good to me. We can land this, backport to stable and beta, and I'll rebase my PR on top of this change.

@tarik02

tarik02 commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

@aiddya should I close this in favor of merged #51161? Will it be backported?

@aiddya

aiddya commented May 16, 2026

Copy link
Copy Markdown
Contributor

@tarik02 #51161 is being backported to 43-x-y in #51658. It can’t be backported any further due to Chromium dependencies.

While you could technically backport this PR by targeting 41-x-y and 42-x-y directly, I don’t think that aligns with Electron’s backport process. I’m not a maintainer, so perhaps @ckerr can provide a definitive answer.

@mitchchn

Copy link
Copy Markdown
Member

I think we should close this one, best to support button order/visibility only with the new ElectronFrameViewLinux in 43.x and above since it's a breaking change. Thanks for the contrib @tarik02 cc: @nikwen.

@tarik02

tarik02 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@mitchchn agree, thank you!

@tarik02 tarik02 closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/requested 🗳 semver/minor backwards-compatible functionality target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. wip ⚒

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux WCO button order is not respected

6 participants