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

Dioxus Applications can permanently corrupt themselves on at least Windows #3604

Open
CryZe opened this issue Jan 20, 2025 · 3 comments
Open

Comments

@CryZe
Copy link
Contributor

CryZe commented Jan 20, 2025

Problem

While recording the video for #3603 I apparently completely corrupted my application. No restarting, no clean build, no nothing does ever result in the application starting again. Even reverting the entire code base to a hello world does not allow the application to start.

Steps To Reproduce

Steps to reproduce the behavior:

  • I do not have a way to reproduce this. It just happens after moving the window between two screens of different DPI for a bit. Maybe you need multiple windows even.

Expected behavior

You should be able to start the application.

Screenshots

Code_9eSmMsUK99.mp4

You can see the window popping up for a tiny bit. The window DOES exist and is in the task bar, but it seems to be "outside of any screen" or something:

Image

What I presume is happening is that moving the window between the screens made it store the location of the window somewhere invalid such that when restarting the application it tries to position the window there again, but it's not anywhere you can reach.

Weirdly the usual hotkeys for moving the window don't help either. I experienced the same bug earlier actually and then I was able to snap out of it by maximizing the window, but this seems to no longer be working.

Environment:

  • Dioxus version: main @ eaf9f80
  • Rust version: 1.83.0
  • OS info: Windows 11
  • App platform: Desktop

Questionnaire

I'm interested in fixing this myself but don't know where to start

@Klemen2
Copy link
Contributor

Klemen2 commented Jan 21, 2025

Had this happened couple of times too quite at random I'd say, the guarantee way of fixing it is to rename the package in cargo.toml, the other way is with window tiling - aka you drag another window to the edge and then choose the app for the other half/quarter.
I do have have two screens of different dpi and windows 11.

@jkelleyrtp
Copy link
Member

Last night I implemented a "session cache" which will reset the window state preservation file between launches of "dx" but keep it consistent within the same session.

I think that might fix this bug.

Can you see if current main desktop + CLI solves this?

@Klemen2
Copy link
Contributor

Klemen2 commented Jan 22, 2025

I can't say for sure, but the recent changes made it so that the window will always open with_inner_size size after build. The only thing is if you disconnect the second monitor, the app will still open on it, preferably if that happened it won't use the saved position.

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

No branches or pull requests

3 participants