[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-07 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #11 from Sven Brauch  ---
FWIW I would provide a patch for this if I could, but I think it's not possible
right now.

Gwenview wants to 1:1 map image pixels to screen pixels for zoom = 100%.

It cannot do that if it gets a surface from the compositor intended for some
scale factor, but no correct information about what that scale factor actually
is.

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-07 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=465688

Nate Graham  changed:

   What|Removed |Added

   Keywords||wayland

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-07 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=465688

Nate Graham  changed:

   What|Removed |Added

 CC||slartibar...@gmail.com

--- Comment #10 from Nate Graham  ---
*** Bug 466738 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-07 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=465688

Nate Graham  changed:

   What|Removed |Added

 Status|REPORTED|CONFIRMED
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-02 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #9 from Sven Brauch  ---
Hi, I tried this and I think Jorge did too, and both of us get "2.0" from
QApplication::devicePixelRatio() with 125% scaling configured in
systemsettings. I also tried in Qt6, and I *still* get "2.0".

Gwenview as a whole scales fine, but the QGraphicsView code calculating the
image size for 100% zoom does not. It ends up with a result that doesn't fill
the screen, even though the image has as many pixels as the screen has, because
devicePixelRatio() is wrong (or is the "2" correct? I think not).

Launching with "-platform xcb" (on Wayland) makes
QApplication::devicePixelRatio() return 1.25 as expected, and also makes
Gwenview's image scaling work correctly again.

I'm running plasmashell 5.26.5 on Manjaro.

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-02 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #8 from Nate Graham  ---
Wayland does support fractional scaling, it's just that the result is a bit
blurry in Qt 5. In 6, this is better. That shouldn't affect Gwenview though and
using devicePixelRatioF() is sane. Feel free to submit a patch!

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-01 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #7 from Sven Brauch  ---
To clarify again, I think there is no problem in Gwenview, its code already
accounts for display scaling in abstractimageview.cpp. It just gets the wrong
scale from Qt.

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-01 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

Sven Brauch  changed:

   What|Removed |Added

 CC||n...@kde.org

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-03-01 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #6 from Sven Brauch  ---
Ok, the situation here seems to be that Wayland only supports integer scaling
at the moment. My 125% scaling is rounded up to 2, which is what is used by
Gwenview to scale the image, which makes it 2 / 1.25 = 1.6 times = 160% too
small.

Apparently Nate knows about this situation? I will add him to the CC list of
this bug. :)

But as I understood, there is nothing that can be done right now until either
Qt6 or until support for fractional scaling on Wayland (which does exist) is
backported to Qt5.

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-02-22 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #5 from Sven Brauch  ---
You need devicePixelRatioF for sure, devicePixelRatio is only for integer
scaling.

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-02-22 Thread Jorge
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #4 from Jorge  ---
Using "devicePixelRatio" methods returns "2" in my case, which may be due to
using KF5/Qt5 under Wayland. I've tried building with Qt6 but with no luck :-/

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-02-21 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #3 from Sven Brauch  ---
By the way, on my screen on Wayland, 125% wouldn't fit either. I need to set
~160%, which I can't make sense of. The only calculation I can come up with
which gives 1.6 would be 1.2 * 1/0.75, but it requires some pretty mixed up
maths to get to that starting from "125% scaling". It's plausible though if
somebody thought subtracting 1 from the devicePixelRatio and then doing some
multiplications was the thing to do.

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-02-21 Thread Sven Brauch
https://bugs.kde.org/show_bug.cgi?id=465688

--- Comment #2 from Sven Brauch  ---
Hi, QWidget has a devicePixelRatioF which contains this 1.25 IIRC:
https://doc.qt.io/qt-6/qpaintdevice.html#devicePixelRatioF -- I think that's
what you need?

-- 
You are receiving this mail because:
You are watching all bug changes.

[gwenview] [Bug 465688] "Fit" on scaled wayland display doesn't fit

2023-02-21 Thread Jorge
https://bugs.kde.org/show_bug.cgi?id=465688

Jorge  changed:

   What|Removed |Added

 CC||jorge_barroso...@hotmail.co
   ||m

--- Comment #1 from Jorge  ---
I have been able to reproduce this when using a display scale different from
100% and a screenshot (ensuring the same size as the display)

The problem seems to come from DocumentView::toggleZoomToFit and
DocumentView::toggleZoomToFill calling "d->setZoom(1., d->cursorPosition());"
with "1." zoom, which should probably be a different value (i.e. 1.25 for 125%
scale), but I'm unsure as to what's the best way to get the current display
scale and apply it to the zoom level instead of a hardcoded "1."

-- 
You are receiving this mail because:
You are watching all bug changes.