texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.77k stars 343 forks source link

toggling between embedded and windowed pdf viewer #3190

Open octaeder opened 1 year ago

octaeder commented 1 year ago

Environment

Expected behavior

switching from embedded to windowed pdf viewer should show the window in the same state as it has been before embedding the viewer, i.e. position, size and maximize state of the window, and position and size when changing the window back from maximized to a normal window.

Actual behavior

  1. After embedding a maximized window it will not be restored to maximized state when switching back to windowed viewer.
  2. Switching from maximized to normal window should restore previous window position and size.

How to reproduce

For simplicity remove profile information for txs. Open an already compiled tex file and start the pdf viewer, then switch to windowed viewer (s. animation below from current master). Maximize window, then embed the viewer, then switch back to windowed viewer. Look at the upper and lower right corners of the window to convince yourself that the window is not in maximized state. Maximize window, then switch to normal window. Position and size of the window are not the same as at the beginning. To repeat just resize or move the pdf viewer, then maximize, embed, ...

pdfMaxWindow-issue (click animation to enlarge, 6 images, 4s per image)

Note

Moving two lines (s. image) ensures that the window is restored maximized when it was maximized before. But this has some unwanted side effects. I tried to change toggleEmbedded, but I couldn't fix the issue.

image

octaeder commented 1 year ago

Also, when ending txs while pdf viewer window is maximized, then pdf viewer window will not be maximized after restarting txs, as shown above it will almost look like it had been maximized.

sunderme commented 1 year ago

What are the mentioned undesirable side effects?

octaeder commented 1 year ago

The original size can't be restored (is close to maximized), and when you embed the normal window and then switch back to windowed viewer the window has moved a little bit to the right. Repeating this procedure again (maybe again a second time) the window slightly shifts out at the right. But embedding and restoring such a window results in a new size of the window with its upper left corner moved to top left corner of the screen. I hope you can reproduce this with win10.

octaeder commented 9 months ago

Fix will also solve side effect mentioned above.