Add high DPI support to internal KWin windows
ClosedPublic

Authored by davidedmundson on Mon, Jan 7, 4:47 PM.

Details

Summary

So far we didn't try to do high DPI on kwin internal windows, such as
the user context menu and tab bars and whatever.

Due to wayland scaling they were the correct phyiscal size but upscaled.
This patch fixes our QPA to enable Qt's high-dpi support.

BUG: 402853

Note icons are still low res. This is because the global
QGuiApplication::devicePixelRatio which is the max of all connected
screens is static for the duration of the app. QIcon uses this when
determining the DPR to use. This will require Qt changes.

Test Plan

Ran at 2x on my normal DPI screen (as that's easier to see anything)

  • User action menu is high DPI
  • Window deco tooltips are still fine
  • Tab switcher is high DPI
  • Overlay in present windows Desktop grid are still ok

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Mon, Jan 7, 4:47 PM
Restricted Application added a project: KWin. · View Herald TranscriptMon, Jan 7, 4:47 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Mon, Jan 7, 4:47 PM
zzag added a subscriber: zzag.Tue, Jan 8, 3:54 PM
zzag added inline comments.
plugins/qpa/window.cpp
105

Should it be floored or rounded?

davidedmundson added inline comments.Tue, Jan 8, 4:02 PM
plugins/qpa/window.cpp
105

Everything is an int

zzag added inline comments.Tue, Jan 8, 4:18 PM
plugins/qpa/window.cpp
105

Oh, shoot, I always think of scale as qreal, sorry. More simpler version:

if (m_contentFBO->size() != geometry().size() * m_scale) {
zzag added a comment.EditedFri, Jan 11, 8:14 PM

I've been testing this patch for a couple days. Everything is good so far. Even with LoDPI icons that's a step forward. :-)

Remove the hack ready for inclusion with the caveat mentioned

davidedmundson retitled this revision from WIP: Add high DPI support to internal KWin windows to Add high DPI support to internal KWin windows.Fri, Jan 11, 10:51 PM
davidedmundson edited the summary of this revision. (Show Details)
zzag accepted this revision.Fri, Jan 11, 11:22 PM
This revision is now accepted and ready to land.Fri, Jan 11, 11:22 PM
graesslin accepted this revision.Sat, Jan 12, 6:33 AM
graesslin added a subscriber: graesslin.

Maybe also add the AA_UseHighDpiPixmaps to the integration test app?

I couldn't test the change as I don't have a high dpi display (well I have but it needs something like 1.4 factor).

This revision was automatically updated to reflect the committed changes.