[BUG] Window size and position is reset after restart of WingetUI
Please confirm these before moving forward
- [X] I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
- [X] I have tested that this issue has not been fixed in the latest (beta or stable) release.
- [X] I have checked the FAQ section for solutions
- [X] This issue is about a bug (if it is not, please use the correct template)
Describe your issue
When repositioning and resizing the window, this is only remembered while WingetUI is open or minimized and reopened. After restarting WingetUI, however, the window position and size is reset.
Steps to reproduce the issue
- Change the window size and position.
- Close the program.
- Restart it.
- Check the size and position of the window.
WingetUI Log
N/A - If you need the logs, just let me know.
Package Managers Logs
N/A - If you need the logs, just let me know.
Relevant information
This happens on two Win10 computers both of which have WingetUI 3.0.0 Beta 0 installed.
Screenshots and videos
No response
In addition, can last selected navigation tab (Discover Packages, Software Updates, etc.) also be remembered/persisted?
Quite annoying. Hope this will be fixed soon, thanks.
OS Name: Microsoft Windows 11 Pro, v10.0.22631 Build 22631 WingetUI v3.0.2
I have ultrawide monitor and this is very annoying as it opens up very wide. Must be set to use x% of screen on open. I have to shrink it a lot as the width is crazy. Then when I open the app again to check, wham super larger again.
I have ultrawide monitor and this is very annoying as it opens up very wide. Must be set to use x% of screen on open. I have to shrink it a lot as the width is crazy. Then when I open the app again to check, wham super larger again.
Confirmed, this happens to mine too. Screen Res is 5120x1440 and on restart of the app, it opens at 3826x1016
Annoying thing. The same problem.
Yes please fix/modify this, very annoying behaviour on ultra wide screens.
@marticliment, position only saved while resizing. If I just move window, position does not saved.
Hi @ishvedov, position is only saved when resizing the window or when closing it. As far as I have been able to find, apparently there is no way to detect when a window has been moved across the desktop
It's does not save on exit. I'm using 3.1.0 alpha 1.
Maybe we could try https://stackoverflow.com/questions/10330470/c-sharp-window-positioning?
This is Windows Forms, UniGetUI is built with WinUI3, which has nothing to do with WinForms
Sorry. What about https://stackoverflow.com/questions/76399809/in-winui-3-is-there-a-way-to-dynamically-set-a-windows-size-and-position?
No, the issue is not with moving the actual window, since this is quite doable. The issue is when detecting when a window has been dragged by the user
Just save the position and dimensions when the window is closed or the application exists. That's common practice and I don't see why you'd need to know when the window is moved or resized.
That is what actually happens, but it seems to not be working properly for @ishvedov
Sorry, yes you're right, I should have read the thread. I haven't tested the alpha version yet, but I'll try to reproduce it later.
I cannot reproduce this on 3.1.0 alpha 1.
- closing the window (minimizing to tray) - works
- closing the window (minimizing to tray), right-click to quit - works
- right-click to quit with window open - works
@ishvedov Is the window completely reset each time you start the application, or does it only/also happen when you restore it from the tray?
I build app from main branch. This line have a problem. Process exits. If I comment this line, all works as expected.
https://github.com/marticliment/WingetUI/blob/d3521feed774363057a555a0d8d1e06f7165620b/src/UniGetUI/Interface/MainWindow.xaml.cs#L484
This line should not have a problem... It is a simple wait command.
Which NET version are you using? Which Visual Studio?
I know it, but... SDK 9.0.100-preview.4.24267.66 SDK 8.0.300 Visual Studio 17.11 preview 1.1 Dotnet runtime for UnigetUI: 8.0.6
I don't see why it would crash on that line... Which is the error triggered? the thread crashes? The code does not compile?
Problem with Delay in handle of Closing event. I add Task.Delay() to event handler, and app exit too on this line.
Program just exit from line with Task.Delay(). Error code 0. No exceptions.
Oh, I see what the issue is now