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

SumatraPDF looses its window size when opens a PDF restored from the Recycle Bin #4169

Open
sergsako opened this issue Apr 5, 2024 · 7 comments

Comments

@sergsako
Copy link

sergsako commented Apr 5, 2024

SumatraPDF version
pre-release 3.6.16004
but stable 3.5.2 is not affected

Describe the bug
When I open a PDF file restored from the Recycle Bin, SumatraPDF forgets its window size and opens half-screen wide

To Reproduce
Steps to reproduce the behavior:

  1. Open a PDF from a folder by double-click.
  2. SumatraPDF respects its last used window size (maximized in my case).
  3. Close the document tab, close the program window, delete the PDF file to the Recycle Bin (using the Windows Explorer, but the same happens if the new command of the pre-release to delete a document is used).
  4. Restore the PDF file from the Recycle Bin to the initial folder and open the PDF by double-click.
  5. SumatraPDF starts with the PDF doc, but in a half-width window.

Expected behavior
SumatraPDF should remember its window size.

File that reproduces the problem
Not related to a specific document.

Screenshots
No screenshots.

Additional context
Windows 10 x64 21H2. SumatraPDF setting: option: default zoom: fit width.

@kjk
Copy link
Member

kjk commented Apr 5, 2024

Can't reproduce. Is it with tabs enabled?

Can you make a video?

@sergsako
Copy link
Author

sergsako commented Apr 5, 2024

Yes, tabs are enabled. Portable SumatraPDF pre-release was used, only the new EXE was put to a usual folder of the program, the sumatrapdfcache folder and SumatraPDF-settings.txt file of the previous version were removed, then after the first start the window was maximized and the "default zoom: fit width" setting was made, no more.
No, I am not able to make a video. Sorry, if the problem is irreproducible.

@sergsako
Copy link
Author

sergsako commented Apr 5, 2024

Video_2024-04-05_204450.mp4

I made a video, somehow.

@kjk
Copy link
Member

kjk commented Apr 5, 2024

Thanks, it's not related to deleting a file, restoring maximized state doesn't work.

Simpler repro:

  • open a file
  • maximize window
  • close the file
  • close the window
  • double-click the file

It should open maximized but instead of flashes as if were maximized and then it seems it gets resized. At the same time the maxmize button shows as if the window was maximized.

So I suspect we first maxmize the window and then resize / reposition the window.

@kjk
Copy link
Member

kjk commented Apr 5, 2024

I can fix it by adding:

        args->noPlaceWindow = true;

in SumatraPDF.cpp@1856 but then it causes to fullscreen even if window wasn't fullscreen when closed.

@reccate
Copy link

reccate commented Apr 6, 2024

This was mentioned in #4036

Started after this commit ea9d8de

@kjk
Copy link
Member

kjk commented Apr 6, 2024

Yeah, that logic is complicated and I frankly don't truly understand it anymore.

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