-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Only set window.titleBarStyle preference if different from active value
#16425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
083b1d5 to
e6a9597
Compare
window.titleBarStyle preference if active value differswindow.titleBarStyle preference if different from active value
msujew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like my changes in #11588 broke with the latest preferences refactoring? I agree that the frontend should definitely filter those preferences out.
packages/core/src/electron-browser/menu/electron-menu-contribution.ts
Outdated
Show resolved
Hide resolved
…tion.ts Extra space snuck in Co-authored-by: Mark Sujew <[email protected]>
Certainly seems that way. At a casual glance, it looks like there is some checking of the |
|
FYI my comment was just to confirm that something is broken - I can't actually test the changes, since I don't have a MacOS system available to me right now. |
@msujew The preference is written regardless of platform, so it is possible to test that part on any OS. Just delete it from your settings JSON, and then check that it doesn't reappear. The only difference on MacOS is that if it does get written, then your settings JSON complains that it shouldn't be there. |
|
@msujew would you have time to take another look? TIA! |
ndoschek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on Ubuntu, and unfortunately it doesn't work for me: removing the line from the user settings file causes it to reappear after a reload.
I assume this is related to the fact that resetting this preference also doesn't work, I think we have here the same problem aswe encountered in #16646.
As noted, this is being tracked further in #16645, which aims to fix other occurrences that rely solely on newValue.
Remove line and reset preference
Screencast.2025-11-28.10.18.33.mp4
@ndoschek The behavior you're seeing is incorrect, but not because the setting is being written to your |
|
Ah, I see, thanks for the explanation! You're absolutely right: testing with Yes, it is a bit strange, but I think in the case where the value is Regarding the reset case: I'll be working on ticket #16645 this month, and I'll make sure to address this case then! But I noticed one more thing: Remove line and switch to customScreencast.2025-12-02.17.35.47.mp4And if I remove the flag entirely, I end up in an infinite reload loop 😅 |
What it does
Fixes #16418 by checking whether writing the preference would be necessary.
How to test
Warning
Arguably, this 'fix' actually reveals a bug. Since the preference should not be included on MacOS, the
inspectcall should returnundefined. At the moment, it doesn't: the preference system in fact has added the preference to its schema, with the appropriate default value ofnative. We should likely fix that, and then ensure that the preference isn't active at all in that case, and that all consumers of the value correctly handle its absence.Follow-ups
Breaking changes
Attribution
Review checklist
Reminder for reviewers