-
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
Enhancement : Avoid electron windows to overlap #9560
Enhancement : Avoid electron windows to overlap #9560
Conversation
6d30f3b
to
e6e1028
Compare
@@ -214,8 +215,8 @@ export class ElectronMainApplication { | |||
* | |||
* @param options | |||
*/ | |||
async createWindow(asyncOptions: MaybePromise<TheiaBrowserWindowOptions> = this.getDefaultBrowserWindowOptions()): Promise<BrowserWindow> { | |||
const options = await asyncOptions; | |||
async createWindow(options: TheiaBrowserWindowOptions = this.getDefaultTheiaWindowOptions()): Promise<BrowserWindow> { |
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.
Why did you change the type from MaybePromise<TheiaBrowserWindowOptions>
to TheiaBrowserWindowOptions
?
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 told to myself that the getDefaultBrowserWindowOptions() wasn't a promise. It returns only default options without waiting for them.
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.
Please revert the type and keep the original method name. Thank you!
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.
@kittaakos I agree that this should be reverted in the context of the current PR, but long term I think the method should just take the TheiaBrowserWindowOptions
and not a promise. If someone deals with a promise, they can resolve it first before calling createWindow
. Is there anything preventing us from doing that, besides being breaking?
e6e1028
to
4692af4
Compare
4692af4
to
c3875bd
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.
I confirmed that the issue can be reproduced on master
and this change addresses it nicely (tested on windows).
Code LGTM as well. 👍
With this enhancement, an electron window, when it's newly opened, has different x and y coordinates than all the previous ones. Therefore, there's no overlap between all the opened electron windows.
c3875bd
to
2a091bb
Compare
Someone willing to merge this? |
With this enhancement, an electron window, when it's newly opened, has
different x and y coordinates than all the previous ones. Therefore,
there's no overlap between all the opened electron windows.
What it does
Fixes #7431
With this enhancement, an electron window, when it's newly opened, has
different x and y coordinates than all the previous ones. Therefore,
there's no overlap between all the opened electron windows.
How to test
Review checklist
Reminder for reviewers