DioxusLabs/dioxus

Reopen window in same place

Opened this issue · 1 comments

Feature Request

It would be really cool if (when performing a full rebuild of desktop app), the CLI could open the window of the new app at the same size and in the same position as the window of the previous version of the app was when it was killed.

Implement Suggestion

  • Determine the size of the apps window (perhaps by asking it over devtools protocol?)
  • Set window size of new window (perhaps with environment variable?)

It used to do this but then we changed the way we killed apps and this broke. We need to elegantly bring down the app (via sigkill) instead of force killing it with a drop.

All the logic for this exists already - and if you gracefully exit the app and re-open it, then it works.

https://github.com/DioxusLabs/dioxus/blob/main/packages/desktop/src/app.rs#L484