PicView icon indicating copy to clipboard operation
PicView copied to clipboard

Unstable window positioning between maximized / full-screen

Open CHerSun opened this issue 5 months ago • 4 comments

Describe the bug When going from maximized window to full-screen and back - window moves erratically, behind the screen borders.

To Reproduce Steps to reproduce the behavior:

  1. Open any image
  2. Maximize window (drag the header to the very top, so that window itself becomes maximized; NOT the window decorator button, which moves the window full-screen)
  3. Go full-screen.
  4. Exit full screen
  5. Window is moves from original position

Expected behavior Keep position / placement, in particular - maximized position.

Screenshots

Collected screenshots to the screen border before entering full-screen mode and after exiting it:

Position Before After
Top-left Image Image
Top-right Image Image
Bottom Image Image

All controls moved a few pixels behind the screen.

Not sure if this is relevant, but UserSettings.json shows negative values:

Image

Also, Windows no longer considers the window as maximized, i.e., dragging it away from the top won't restore original size (without going full screen this works as expected too).

Additional context Add any other context about the problem here.

CHerSun avatar Jul 15 '25 15:07 CHerSun

Strange width and height btw. I have Windows high-dpi scaling enabled at x1.5 factor. For PicView the scaling is set to be app-controlled in compatibility settings (otherwise it looks blurry). I've double-checked removing the compatibility settings doesn't affect the app behavior. Global scaling could be one of the reasons.

CHerSun avatar Jul 15 '25 15:07 CHerSun

I have made a quick hot fix release regarding your two issues. It was because I changed from ReactiveUI to R3, where the window sizing subscription works differently, which I didn't initially discover.

You should check #197 regarding DPI. I don't use scaling myself, but after testing it, that seemed to solve it. Don't know about the negative values. They are read and saved by the system itself.

Ruben2776 avatar Jul 16 '25 14:07 Ruben2776

@Ruben2776 thank you for such a fast reaction. And thank you for PicView, I really like it.

Regarding this issue - it doesn't look to be fixed in v3.1.5.1 hotfix - after going fullscreen and exitting it the window now does something like an extra blink (a fast resize?), but it still goes outside of the screen a bit and can't de-maximize to normal previous size. Can I maybe help in any way? Like, collect some debug logs?

This issue isn't a critical one really, but unpleasant.

CHerSun avatar Jul 17 '25 19:07 CHerSun

@CHerSun Thank you, I am glad you like PicView.

I have pushed new updates regarding window size calculations. It should work better now, since I am no longer relying on recalculating the size to fix it.

it still goes outside of the screen a bit

The window expanding larger than the main monitor screen estate, has also been reported in #202. It starts up correctly in maximized state, but once it has been fullscreen this issue appears (on my Win 10 machine). Are you experiencing differently? Are you using win11?

and can't de-maximize to normal previous size

I can't reproduce this.

Can I maybe help in any way? Like, collect some debug logs?

Can you tell me if still experience it in this version (be logged into GitHub and download at bottom of page): https://github.com/Ruben2776/PicView/actions/runs/16416749691


The blinking issue, is the window being moved and resized to a new location, very fast. To make it more smooth, I'd have to figure out how to set the correct initial size, before it is shown, at startup.

The problem is not so bad, when starting up in normal state (non-maximized/fullscreen state). However, when starting in fullscreen, or maximized state, I have to apply some delay and additional fixes, to resolve the selecting the correct monitor, as stated in #198.
There are some comments about it in https://github.com/Ruben2776/PicView/blob/dev/src/PicView.Avalonia/StartUp/StartUpHelper.cs#L145 but I have to figure out a better way to do it, for it not top blink.

Ruben2776 avatar Jul 21 '25 13:07 Ruben2776