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

Closing window when maximized updates size of window with maximized size & doesn't reopen window maximized #76

Open
OCD-Man opened this issue Aug 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@OCD-Man
Copy link

OCD-Man commented Aug 24, 2022

I use the following setting in the ini file:
DefaultWindowRect=sticky

which makes it so that the following setting is updated to save the current window size when the window is closed so that the next time I open the window it opens with the same window size.
StickyWindowRect=121 163 1022 826

That functions incorrectly when the window is closed while it is Maximized.

There are 2 issues after I close the window while it is Maximized:

  1. When the Window is opened again (by double clicking any picture), it is no longer Maximized.

  2. But an even bigger problem is that when the window is opened again, the "StickyWindowRect=" setting in the ini file gets updated with the size of the Maximized window. But as I said in the first issue, the window isn't Maximized anymore when it is reopened, and instead it is the same size as the size of the maximized window which fills up the screen. So I have to move the window to get access to the corner of the window to make it smaller again. Since it looks like it is Maximized, I end up trying to unmaximize it at first which gets very annoying when it doesn't work.

To be clear, the 2nd issue is that the following setting in the .ini file should not be updated when the window is closed while it is Maximized, and should only be updated when the window is closed while it is NOT Maximized:
StickyWindowRect=121 163 1022 826

It is normal for a program to reopen a window Maximized if it was closed Maximized, and otherwise to open the window in the size it was when it was closed, So I even suggest the following setting to be the default setting:
DefaultWindowRect=sticky

This is something I hope you can fix soon along with issue #14 where both of these issues are causing great annoyance in my daily usage of JPEGView. For other features like animated webp, I can just use another program at those rare times. But I personally think that this issues & issue #14 should be among the priorities since they are so frustrating.

Also this issue seems to be only partly connected to issue #56 , at least for the 1st part of this issue with the window not opening maximized again. But in issue #56 when changing to full screen when the window is Maximized, and then getting out of full screen, even though the window at that point is no longer Maximized when it should be, at least the window goes back to the size it is supposed to be when it is no longer Maximized. But that is because the window needs to be closed to update "StickyWindowRect=" in the settings ini file. So this issue shows that issue #56 also happens when the window is closed and not just when it is set to full screen. Maybe that will help to narrow down at least that issue restoring the Maximized window, which hopefully will automatically fix the second problem with the window size being updated as well. But I am not a programmer, so that is just hopeful thinking.

Edit: I forgot to mention that I am using Windows 7 Home Premium 64-bit and I am using the portable version of JPEGView 64-bit (the .7z file) rather than the .msi file, and this has been happening since version 1.0.37.1 up to 1.0.40.

@OCD-Man
Copy link
Author

OCD-Man commented Aug 24, 2022

I am not a programmer, but maybe it would make sense that the "DefaultWindowRect=sticky" setting (besides being connected to the "StickyWindowRect=" setting) should also be connected to another setting that could be created and named "Maximized=" with 2 options being "yes" & "no", and could be automatically updated when the window is closed.

So that new setting could be updated first before "StickyWindowRect=" is updated so that "StickyWindowRect=" can be made to only be updated only if the "Maximized=" setting is set to "no", but if it is set to "yes", then "StickyWindowRect=" shoud not be updated.

However I guess there should be another way to make the window reopen in a Maximized state without using the ini settings file. But the logic of my suggestion is what I wanted to communicate.

Also my suggestion doesn't cover fixing issue #56 unless my suggested addition of a setting named "Maximized=" is also updated when selecting full screen mode, or at the moment the window is maximized. But it seems wrong to me to continuously change the ini file that often. So maybe there is a way to link the "DefaultWindowRect=sticky" setting to whatever programming is done to save the Maximized state without using the ini file so that the same kind of thing can be done as I suggested.

I hope I haven't been insulting by stating things that may be obvious. I just felt the need to communicate my thoughts in order to help get this fixed ASAP.

@sylikc
Copy link
Owner

sylikc commented Feb 16, 2023

@OCD-Man just letting you know i've read the detailed description for this bug report, but there's more than meets the eye... and I always appreciate more detail over less detail 😉

the interactions of maximized with sticky should be fixed, but it would not be a straightforward fix. Having another option be saved into the ini (I'm already looking into how that save/user ini system works, and I haven't started hacking away at it, but it's going to CHANGE... I just don't know the best way to change it yet.)

JPEGView would probably have to keep track of the dimensions in both maximized and not maximized mode, and save those values in memory when it goes from one to another... I'm curious how this reads in Windows 10 where there's sticky borders... it's probably going to require some investigation, as when you "dock" windows to the left or right side, I wonder if it thinks it's maximized.

then there's also two states of maximized... windowed maximized and fullscreen. and then there's the no title bar ... where dimensions also get funky.

As for the default of DefaultWindowRect=sticky, it ... can't really be right now... because it requires write access to the INI file, and not something that would work in a "installed" environment. It could save a user INI on startup... but like i said, JPEGView.INI interactions right now are *($@#&!

@sylikc sylikc added the bug Something isn't working label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants