Bug 498680 - Per monitor scaling changes image size when dragging across monitors
Summary: Per monitor scaling changes image size when dragging across monitors
Status: ASSIGNED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 24.12.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-15 05:33 UTC by madness742
Modified: 2025-03-07 15:02 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of the image on the main monitor (100% scaling). (647.04 KB, image/png)
2025-01-15 05:33 UTC, madness742
Details
Screenshot of the image on the second monitor (150% scaling). (687.23 KB, image/png)
2025-01-15 05:34 UTC, madness742
Details
Screenshot of the bugged viewfinder. (526.87 KB, image/png)
2025-01-15 05:35 UTC, madness742
Details
Showcase of the resize bug. (3.89 MB, video/mp4)
2025-02-05 12:33 UTC, madness742
Details
Behaviour on Merge Request 319 (3.59 MB, video/mp4)
2025-02-05 15:41 UTC, madness742
Details
bug with navigator (304.12 KB, video/webm)
2025-03-07 14:04 UTC, Benjamin Dedieu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description madness742 2025-01-15 05:33:55 UTC
Created attachment 177368 [details]
Screenshot of the image on the main monitor (100% scaling).

SUMMARY
When dragging an image across monitors, with scaling set to >=105% on the secondary monitor, the image will get resized. Similar to bug 498679, when scaling is set to <=100% on the secondary monitor, it behaves how it should.

This also causes the viewfinder to get glitched. A workaround for both of these problems are mentioned at the bottom.

STEPS TO REPRODUCE
1. Start a Wayland session.
2. Plug in two monitors.
3. Set primary monitor to 100% scaling .
4. Set secondary monitor to 105% or higher scaling.
5. Open an image in gwenview on the main monitor.
6. Drag the image to the second monitor.

(If you can't reproduce it, click the 'fit' button twice and try again.)

OBSERVED RESULT
The image becomes smaller, and the window gets larger.

EXPECTED RESULT
It should not change in size when dragging across the monitors.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 41
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1

ADDITIONAL INFORMATION
This has a workaround, launching gwenview with `QT_QPA_PLATFORM=xcb`, but this makes the UI blurry on the second monitor.
Comment 1 madness742 2025-01-15 05:34:41 UTC
Created attachment 177369 [details]
Screenshot of the image on the second monitor (150% scaling).
Comment 2 madness742 2025-01-15 05:35:33 UTC
Created attachment 177370 [details]
Screenshot of the bugged viewfinder.
Comment 3 Nate Graham 2025-01-15 18:40:18 UTC
Can reproduce.
Comment 4 Bug Janitor Service 2025-02-04 09:56:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/317
Comment 5 David Redondo 2025-02-05 08:57:12 UTC
Git commit 708c0f5f5eb829573e5681caebcedeb857574a1b by David Redondo.
Committed on 04/02/2025 at 09:55.
Pushed by davidre into branch 'master'.

birdseyeview: Use actual dpr

Fixes the birdseyeview with fractional scaling. QGuiApplication
will return the maximum dpr of all screens instead of our window.
On Wayland window and screen dpr will be different.

M  +4    -2    lib/documentview/birdeyeview.cpp

https://invent.kde.org/graphics/gwenview/-/commit/708c0f5f5eb829573e5681caebcedeb857574a1b
Comment 6 David Redondo 2025-02-05 08:58:10 UTC
I couldn't reproduce the image being resized when dragging the window around. Maybe I did not understand the instructions correctly.
Comment 7 Bug Janitor Service 2025-02-05 08:58:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/318
Comment 8 David Redondo 2025-02-05 09:13:16 UTC
Git commit d88227f20e60c11d10eb5fce8f0fba5f28c29552 by David Redondo.
Committed on 05/02/2025 at 08:58.
Pushed by davidre into branch 'release/24.12'.

birdseyeview: Use actual dpr

Fixes the birdseyeview with fractional scaling. QGuiApplication
will return the maximum dpr of all screens instead of our window.
On Wayland window and screen dpr will be different.


(cherry picked from commit 708c0f5f5eb829573e5681caebcedeb857574a1b)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +4    -2    lib/documentview/birdeyeview.cpp

https://invent.kde.org/graphics/gwenview/-/commit/d88227f20e60c11d10eb5fce8f0fba5f28c29552
Comment 9 madness742 2025-02-05 12:30:33 UTC
(In reply to David Redondo from comment #6)
> I couldn't reproduce the image being resized when dragging the window
> around. Maybe I did not understand the instructions correctly.

The problem is more noticeable the higher the scaling is set to. I'll attach a video where you can see how I reproduce the bug.

The recent merge however has solved the birds eye view problem, thank you!
Comment 10 madness742 2025-02-05 12:33:26 UTC
Created attachment 177988 [details]
Showcase of the resize bug.

Left gwenview is compiled from source, version 25.03.70.
Right gwenview is from Fedora 41 repo, version 24.12.1.
Comment 11 David Redondo 2025-02-05 13:02:35 UTC
Thanks, I see now and can repodruce it. I tried with a maximized window before, and since it changes the size of the window it reevaluates size.
Comment 12 Bug Janitor Service 2025-02-05 14:29:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/319
Comment 13 madness742 2025-02-05 15:02:42 UTC
I have tested the merge request, and it works great when the image is set to "Fit", but unfortunately any other setting ("Fill" or any percentage) has the resize bug when dragging the image to my second monitor.
Comment 14 David Redondo 2025-02-05 15:16:41 UTC
I tested it with a set percentage, of course on scaled it will look smaller. With fit it seems to work for me. Feel als ofree to comment on the MR
Comment 15 madness742 2025-02-05 15:37:41 UTC
Sure thing, I'll upload the current behaviour on here as I'm not sure if invent supports file uploads.
Comment 16 madness742 2025-02-05 15:41:57 UTC
Created attachment 177993 [details]
Behaviour on Merge Request 319

Monitor 1 (Primary, right): 2560x1440 @125% scaling.
Monitor 2 (Secondary, left): 38420x2160 @175% scaling.

Notice how the zoom level changes when the picture is set to "Fit" and dragged to the secondary monitor.
Comment 17 Benjamin Dedieu 2025-03-07 14:04:38 UTC
Created attachment 179206 [details]
bug with navigator

In a similar multimonitor and mixed Dpi setup (100% for the main one, and 200% for the second one), I also have observed the bug for quite a while. I would like to add that in the 100% scale monitor, zooming on the image results in a bug with the navigator (the rectangle at the bottom right that help you scroll in your image) as shown in the video attached. I think this could be linked with this bug. Otherwise I would open another bug report if it is not.
Comment 18 Benjamin Dedieu 2025-03-07 15:02:52 UTC
(In reply to Benjamin Dedieu from comment #17)
> Created attachment 179206 [details]
> bug with navigator
> 
> In a similar multimonitor and mixed Dpi setup (100% for the main one, and
> 200% for the second one), I also have observed the bug for quite a while. I
> would like to add that in the 100% scale monitor, zooming on the image
> results in a bug with the navigator (the rectangle at the bottom right that
> help you scroll in your image) as shown in the video attached. I think this
> could be linked with this bug. Otherwise I would open another bug report if
> it is not.

Sorry, I did not realized this additional problem was already reported here. I tested the master branch, and I can confirm that the viewfinder problem is fixed. However, there is still the scaling problem.