-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enable clients to persistently change the electron windowOptions #7787
Conversation
9dfece4
to
cd08876
Compare
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.
Thank you for the contribution @owlJaeger.
I don't see the value of having such a configuration personally, frameless windows cannot be resized or closed properly and thus would not be suitable options for an IDE-like application. There are also limitations on macOS as described in the documentation which require additional support which is not handled properly in this pull-request.
dev-packages/application-manager/src/generator/frontend-generator.ts
Outdated
Show resolved
Hide resolved
I am working on a client which want's this because it will handle window dragging and controls itself. At the moment I cannot check the MacOS problem. Resizing works for me on Windows though. I will test it on Linux. |
@vince-fugnitto I hope the addition of the |
Maybe it should be configurable depending on the OS? Or should we just give a frameless option that will automatically check whether or not it is on macOS and if it is, use I think the single |
ea5b115
to
346282b
Compare
@akosyakov @vince-fugnitto What do you think about these changes? These enable clients to take full control over the |
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 verified the changes and they work well, I believe it is a better implementation than the first draft 👍
dev-packages/application-manager/src/generator/frontend-generator.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Luca Jaeger <[email protected]>
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.
The changes look good to me!
I'll give others a chance to review as well.
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.
Code is LGTM.
As soon as this gets merged, I will create a follow-up PR enabling clients to set the default windowOptions through a tag inside |
@owlJaeger I am not involved much in electron products like @spoenemann @kittaakos @thegecko @westbury for instance. It would be good to hear from them whether we need such flexibility. |
@marechal-p @thegecko please merge then you think it is good |
I am sorry... GitHub made me think that my review worked, but it didn't. So I'll copy what I've written in my review. Review 1:I am concerned however, when saving
through Review 1 Comment 2:I've developed a new approach. The new approach doesn't have that problem because it just stores what gets overwritten. So if the user doesn't change anything on purpose, everything works just as usual. For this new approach I will open a new Pull Request though because it not only introduces that, but also two other things. I'd prefer the new approach to be merged as it doesn't have the aforementioned flaws. After I've created it, the new PR should be reviewed and changed if needed. I'd like to keep this PR open until the other one is merged. If that happens, this can be closed. The other PR may need to be split into multiple PR's. At the moment it has multiple commits which I think, are related. But that's then up to you and the other reviewers. Edit:The PR is created now and doesn't look like it has to be split. |
@akosyakov @marechal-p |
Signed-off-by: Luca Jaeger [email protected]
What it does
I think clients should be able to make the electron window borderless. This was implemented by enabling clients to persistently change the electron windowOptions. This also enables clients to change it through the Theia preferences ( they still have to restart the window ). Example for making the window borderless:
How to test
(I've modified packages/core/src/electron-browser/menu/electron-menu-contribution.ts, onStart, for testing)
2. Restart the example.
Review checklist
Reminder for reviewers