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

fix app starting offscreen #548

Merged
merged 4 commits into from
Jan 22, 2022
Merged

fix app starting offscreen #548

merged 4 commits into from
Jan 22, 2022

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Jan 11, 2022

Aims to fix issues such as #193 #542, probably fix #517

checks if the app is completely offscreen (x / width) or if the titlebar is offscreen (y / height)

checks if window is inside the display closest to the given point

Tested on multiple monitor setup and works perfectly

index.js Outdated Show resolved Hide resolved
@Araxeus
Copy link
Collaborator Author

Araxeus commented Jan 16, 2022

now also check if the titlebar y coordinate is offscreen

(often maximized app will have -8,-8 coordinates)
@Araxeus Araxeus marked this pull request as draft January 19, 2022 18:07
@Araxeus Araxeus marked this pull request as ready for review January 19, 2022 20:12
@Araxeus
Copy link
Collaborator Author

Araxeus commented Jan 19, 2022

f5e22b5 made it so that the app validate the coordinates if they are inside the coordinates of the closest display to the given point

  • get saved absolute coordinates (grid start point (0,0) is the top left corner of the primary monitor)
  • get monitor closest to said point
  • check if given coordinates is inside the rectangle of the closest monitor

monitor rectangle top left is (bounds.x, bounds.y)
and obviously bottom right is (bounds.x + bounds.width, bounds.y + bounds.height)

Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

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

Looks good, just one question before merging!

index.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Now the app itself is not opening
2 participants