qimgv icon indicating copy to clipboard operation
qimgv copied to clipboard

Fit to window doesn't work on qt6

Open Rabcor opened this issue 1 year ago • 8 comments

Settings: image

Result: image

Fit to window actually makes the image much smaller than the window for me, always, aspect ratio of the image itself vs window doesn't seem to matter much at all.

Even if I use the automatic resize setting, image will still be a lot smaller than the window, it's like qimgv doesn't properly recognize the size of the window, maybe cuz I'm on wayland or something?

Edit: I've found out that it's related to qt6ct somehow, i tried both of the qimgv qt6ct versions in AUR and had this issue, i tried the qt5ct version and it's fine there, although that version opens videos in a separate window.

Rabcor avatar Dec 17 '24 21:12 Rabcor

From your settings where it says "Expand images, up to" "4x". That's the limit you set for it to expand to. Only 4x it's original resolution.

If you move that slider all the way to the left to set it to "-" nothing. It will fill the window by the longest dimension.

soul4kills avatar Jan 09 '25 18:01 soul4kills

From your settings where it says "Expand images, up to" "4x". That's the limit you set for it to expand to. Only 4x it's original resolution.

If you move that slider all the way to the left to set it to "-" nothing. It will fill the window by the longest dimension.

The image i used in my examlpe is 4k, my monitor is only 1440p. The image is displayed at 36% of it's original size, no matter what I set it to.

Rabcor avatar Jan 10 '25 21:01 Rabcor

Last thing you could try is uncheck "Unlock Minimum Zoom". That prevents the zoom level going anything below the window size. So it lets you zoom in but not zoom out.

soul4kills avatar Jan 12 '25 00:01 soul4kills

I'm also having this problem while in Plasma Wayland and using Qt6 builds. The Qt5 builds are unaffected by this. And Plasma X11 doesn't get affected by either Qt versions.

What's even more interesting is that if I adjust my monitor scaling to 1.0 (instead of 1.5 which is what I use), it solves the problem. Though not ideal for me when I'm using 4K monitors.

kenrap avatar Nov 23 '25 15:11 kenrap

I just realized that a suitable workaround would be to launch qimgv with QT_QPA_PLATFORM=xcb as its local environment variable while in Wayland.

kenrap avatar Nov 23 '25 16:11 kenrap

I just realized that a suitable workaround would be to launch qimgv with QT_QPA_PLATFORM=xcb as its local environment variable while in Wayland.

Won't that just run it on xwayland? I'm not actually having this problem right now but it's probably because my display scaling is set to 1.0 atm. There was something else though, I was having some scaling issues with qt apps and I had an environment variable i used to resolve that which might help with this.

QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor

Rabcor avatar Nov 24 '25 13:11 Rabcor

@Rabcor That environment variable works for me! Thanks for sharing that solution.

The reason I was using Xwayland was because the problem doesn't occur for me while in X11. So I thought that would be the workaround to use. But using QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor is way better! 👍

kenrap avatar Nov 24 '25 17:11 kenrap

Yeah, this is a problem with qt itself I think.

Rabcor avatar Nov 25 '25 06:11 Rabcor