replit / desktop

Replit Desktop App
114 stars 3 forks source link

Don't restore window bounds if prev dimensions are out of bounds #85

Closed sergeichestakov closed 1 year ago

sergeichestakov commented 1 year ago

Why

It looks super weird when we restore the window bounds but the number of monitors has changed (esp if you remove an external monitor). Instead, we should just bail since you'll likely want to rearrange the dimensions or position of your window anyways in response to an external monitor being added or removed.

Fixes WS-34

What changed

Test plan

linear[bot] commented 1 year ago
WS-34 🤷Sergei Chestakov: probably should special case how we restore window dimensions when you no longer have an external display. when I unplug from mine and re-open the app, the repl window keeps re-opening very far to the right of the screen and is barely visible

Slack Link: [https://replit.slack.com/archives/C0509G0FJNL/p1685546439.358829](https://replit.slack.com/archives/C0509G0FJNL/p1685546439.358829) Sergei Chestakov: probably should special case how we restore window dimensions when you no longer have an external display. when I unplug from mine and re-open the app, the repl window keeps re-opening very far to the right of the screen and is barely visible

szymonkaliski commented 1 year ago

Hm, not sure if this is the right signal to react to, like, you could still have the same number of screens, but previously used a 50'' external TV, and now opening the app on 21'' external display?

I think maybe a more correct way would be to check if the stored window bounds fit within the available screen bounds, and if not, then adjust the window so it's visible?

Wdyt?

sergeichestakov commented 1 year ago

ahh yeah good point. was a bit unsure about this heuristic as well tbh. will try checking the bounds instead

sergeichestakov commented 1 year ago

@szymonkaliski I'm checking the bounds now instead in the latest commit. lmk what you think!