Add high DPI support to internal KWin windows
ClosedPublic

Authored by davidedmundson on Jan 7 2019, 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
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6996
Build 7014: arc lint + arc unit
davidedmundson created this revision.Jan 7 2019, 4:47 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 7 2019, 4:47 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jan 7 2019, 4:47 PM
zzag added a subscriber: zzag.Jan 8 2019, 3:54 PM
zzag added inline comments.
plugins/qpa/window.cpp
105

Should it be floored or rounded?

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

Everything is an int

zzag added inline comments.Jan 8 2019, 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.EditedJan 11 2019, 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.Jan 11 2019, 10:51 PM
davidedmundson edited the summary of this revision. (Show Details)
zzag accepted this revision.Jan 11 2019, 11:22 PM
This revision is now accepted and ready to land.Jan 11 2019, 11:22 PM
graesslin accepted this revision.Jan 12 2019, 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.