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

Window size/position is not remembered when opening from tray #51

Closed
berrnd opened this issue Apr 17, 2015 · 3 comments
Closed

Window size/position is not remembered when opening from tray #51

berrnd opened this issue Apr 17, 2015 · 3 comments

Comments

@berrnd
Copy link
Contributor

berrnd commented Apr 17, 2015

Hi, and first thanks for this great wrapper for Syncthing! :)

The position and size of the main window is always reset to default when restoring from tray.
On smaller screens I use SyncTrayzor always maximized, so it would be great if the window state is saved, also when closing and restarting the application.

I have looked over the code, thought I fix it myself ... but I'm not that much into WPF ... just saw that it must have something to do with Stylets WindowManager.CreateWindow function... (?)

@canton7
Copy link
Owner

canton7 commented Apr 17, 2015

Fair request! This is a problem I know enough about to know that it isn't trivial - things like monitors changing, resolution changing, etc, can cause your windows to be restored to desktops that no longer exist, or in places the mouse can't get to (like the title bar being above the top of the screen). I've got some badly-written programs which like to do things like this, and it's really annoying.

Actually implementing this will be fairly easy (I'd bind the ShellView's StartupLocation, Top, Left, Width, and Height through to properties on ShellViewModel), but I want to make sure I understand all of the gotchas before trying to implement this! Luckily I've got the whole weekend to work on SyncTrayzor, so let's see what happens.

@canton7
Copy link
Owner

canton7 commented Apr 18, 2015

Turned out to be fairly easy - there's a set of native methods to handle all of the edge-case logic

canton7 added a commit that referenced this issue Apr 18, 2015
@berrnd
Copy link
Contributor Author

berrnd commented Apr 18, 2015

Cool! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants