Skip to content
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

Check and fix window dimensions and position when the application start #2476

Closed
laurent22 opened this issue Feb 8, 2020 · 7 comments · Fixed by #2514
Closed

Check and fix window dimensions and position when the application start #2476

laurent22 opened this issue Feb 8, 2020 · 7 comments · Fixed by #2514
Assignees
Labels
bug It's a bug desktop All desktop platforms

Comments

@laurent22
Copy link
Owner

laurent22 commented Feb 8, 2020

It happens that the Joplin window, when starting, is off-screen or has invalid dimensions, like 1x1 pixel.

After the app is started (1 or 2 seconds after to make sure it's properly initialised), there should be two checks:

  • Check that the window has correct dimensions (for example a minimum of 100x100 pixels)
  • Check that the window rectangle is within one of the active screens.

If it's not, the window should be moved to the right location and set to the right dimensions.

You will need to make sure that it works also when the "Start minimised" option is enabled in the settings. In other words, the code shouldn't make the window visible when it should in fact be minimised.

@laurent22 laurent22 added bug It's a bug good first issue desktop All desktop platforms labels Feb 8, 2020
@daukadolt
Copy link
Contributor

Can I take on the issue?

@laurent22
Copy link
Owner Author

Yes please, go ahead.

@tessus
Copy link
Collaborator

tessus commented Feb 15, 2020

@daukadolt any update? It would be nice to keep us apprised.

@daukadolt
Copy link
Contributor

@tessus hi! Sorry for inactivity. Due to force majeure could not start until recently.
I've resolved the window size issue and am currently working on the second issue. I hope to open up a pull request today (UTC+6) or by tomorrow midday.

@alishamohanty
Copy link

Is the issue still open?

@tessus
Copy link
Collaborator

tessus commented Feb 22, 2020

Yep, a PR is already available.

@FlinnBurgess
Copy link

For those experiencing this issue I've realised that when I open joplin there's a very tiny section of the window that appears on the left-hand side of my screen. I was able to expand the window to full size using this.

laurent22 pushed a commit that referenced this issue Feb 27, 2020
…lication starts (#2514)

* ElectronClient window minimum size set

Hardcoded minimum width and height of 100 px.

Signed-off-by: daukadolt <daulet.amirkhanov.official@gmail.com>

* Set Electron window position if outside displays

Set Electron window at the center of primaryDisplay if BrowserWindow is not on any displays.

Signed-off-by: daukadolt <daulet.amirkhanov.official@gmail.com>

* Set Electron window default size dependent on screen

Set Electron window defaultWidth, defaultHeight to 80% of primary display workArea width, height, respectively.

Signed-off-by: daukadolt <daulet.amirkhanov.official@gmail.com>

* Hotfixing Electron defaultHeight depending on width, not height

Hotfix of a typo that calculates Electron app's default height at first run using primary screen's width, not height.

Signed-off-by: daukadolt <daulet.amirkhanov.official@gmail.com>

* Refactoring Electron app defaultWidth/defaultHeight setup

Setting defaultWidth/defaultHeight directly without extra variables.
Rounding defaultWidth/defaultHeight.

Signed-off-by: daukadolt <daulet.amirkhanov.official@gmail.com>
@lock lock bot locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug desktop All desktop platforms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants