Bug 504978 - Gwenview's Print Preview Window Size is Tiny in Multi-screen Setups
Summary: Gwenview's Print Preview Window Size is Tiny in Multi-screen Setups
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (other bugs)
Version First Reported In: 25.04.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-29 18:13 UTC by Lenzoid
Modified: 2025-06-03 18:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 25.04.3
Sentry Crash Report:


Attachments
Demonstration Screenshot (1017.47 KB, image/jpeg)
2025-05-29 18:18 UTC, Lenzoid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lenzoid 2025-05-29 18:13:46 UTC
SUMMARY
On one of the two screens, the Print preview window being opened is way too small. At least Gwenview from git-master and also flatpak (25.04.1) are affected.

STEPS TO REPRODUCE
1. Have more than one screen
2. In Gwenview open File > Print preview 
3. If you don't see it, move Gwenview to the other screen and try there.

OBSERVED RESULT
On one of the two screens, the Print preview window being opened is way too small.

EXPECTED RESULT
It size should be comparable to the parent window and not that tiny.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.0
Kernel Version: 6.14.7-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X3D 8-Core Processor
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 2070 SUPER
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B85
System Version: 1.0

ADDITIONAL INFORMATION
Moving straight to ASSIGNED, because it was reported by Jason and I could confirm it. I have written and locally tested a simple fix by including a simple resize of the window based on the parent window, analogous to the solution implemented in Kate seen here: 
https://invent.kde.org/frameworks/ktexteditor/-/blob/master/src/printing/kateprinter.cpp?ref_type=heads#L185

Nate said this is a Qt bug but since the fix is trivial I chose to do this first.
Comment 1 Lenzoid 2025-05-29 18:15:25 UTC
Will have a MR soon.
Comment 2 Lenzoid 2025-05-29 18:18:59 UTC
Created attachment 181879 [details]
Demonstration Screenshot
Comment 3 Bug Janitor Service 2025-05-30 12:58:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/333
Comment 4 Nate Graham 2025-06-03 18:31:00 UTC
Git commit 2974b19e0cb5e0265cef7d932648a43162177a76 by Nate Graham, on behalf of Matthias Danzl.
Committed on 03/06/2025 at 18:28.
Pushed by ngraham into branch 'master'.

Fixing Gwenview print preview window size in multi-screen setups

By inserting a resize of the preview dialog it works around the bug
exclusive to multi-screen systems where this preview window is opened
with a tiny size.

This solution is adopted from a portion in bool KatePrinter::printPreview()

It has been suggested that this is a Qt bug. While that may be so, the
purpose of this is to provide a workable solution until the root cause
is addressed properly. So far I have not found an existing Qt issue for this.

M  +6    -0    lib/print/printhelper.cpp

https://invent.kde.org/graphics/gwenview/-/commit/2974b19e0cb5e0265cef7d932648a43162177a76
Comment 5 Nate Graham 2025-06-03 18:32:41 UTC
Git commit 8dd932534d805e055173ebbe77096a03f64124e3 by Nate Graham.
Committed on 03/06/2025 at 18:32.
Pushed by ngraham into branch 'release/25.04'.

Fixing Gwenview print preview window size in multi-screen setups

By inserting a resize of the preview dialog it works around the bug
exclusive to multi-screen systems where this preview window is opened
with a tiny size.

This solution is adopted from a portion in bool KatePrinter::printPreview()

It has been suggested that this is a Qt bug. While that may be so, the
purpose of this is to provide a workable solution until the root cause
is addressed properly. So far I have not found an existing Qt issue for this.


(cherry picked from commit 2974b19e0cb5e0265cef7d932648a43162177a76)

Co-authored-by: Matthias Danzl <md@ml1.net>

M  +6    -0    lib/print/printhelper.cpp

https://invent.kde.org/graphics/gwenview/-/commit/8dd932534d805e055173ebbe77096a03f64124e3