Skip to content

Commit

Permalink
fix(app/onivim#3349): Fix broken window positioning w/ multiple monit…
Browse files Browse the repository at this point in the history
…ors (onivim#3443)

__Issue:__ As described in onivim#3349 , when there are two monitors, Onivim will by default start in the middle of both of them.

__Defect:__ The root cause is this commit to Revery - revery-ui/revery@08c2131 - the centering logic causes the calculated position to be in the center of the two monitors.

In addition, in the presence of this bug, there weren't good tools in place to workaround it - ideally, there should be a way to manually specify the window position in the absolute worst case.

__Fix:__
The fix for the bug is in Revery, here: revery-ui/revery#1059

In addition, this PR adds a couple of command-line options:
__`--list-displays`__ - shows a list of available displays and positions, like: 

```sh
oni2 --list-displays
Displays:
0: LG Ultra HD - x: 0 y: 0 width: 1920 height: 1080
1: Color LCD - x: 305 y: 1080 width: 1440 height: 900
```

__Todo:__
- [x] Need to account for the 'upgrade' case - there may be values persisted for `windowX` and `windowY` in the store, so that users hitting onivim#3349 would continue to hit it, even with this fix.

__`--window-position` - set the window position manually, in the display space. For example, if I wanted to start the Onivim on the second display above, I could use `oni2 --window-position=305,1080` to position it on the second display.

- [x] Depends on revery-ui/revery#1059

Fixes onivim#3349
  • Loading branch information
bryphe authored Apr 22, 2021
1 parent 85f6634 commit e6ea68b
Show file tree
Hide file tree
Showing 36 changed files with 687 additions and 373 deletions.
1 change: 1 addition & 0 deletions CHANGES_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
- #3435 - Completion: Fix various mouse interactions (fixes #3428)
- #3439 - Hover: Remove textOverflow(Ellipsis) from hover
- #3442 - Buffers: Fix regression causing control+tab menu not to stay open (related #3442)
- #3443 - App: Fix broken window positioning w/ multiple monitors (fixes #3349)

### Performance

Expand Down
78 changes: 39 additions & 39 deletions bench.esy.lock/index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e6ea68b

Please sign in to comment.