Properly render XWayland windows in SceneQPainter
ClosedPublic

Authored by graesslin on Jul 27 2017, 3:50 PM.

Details

Summary

The buffer for a XWayland window is larger than the actual size. Thus
we need to use the clientSize as reference, not the buffer size.

BUG: 382748

Test Plan

Test passes

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.
graesslin created this revision.Jul 27 2017, 3:50 PM
Restricted Application added a project: KWin. · View Herald TranscriptJul 27 2017, 3:50 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
davidedmundson requested changes to this revision.Jul 27 2017, 4:01 PM
davidedmundson added a subscriber: davidedmundson.

That almost certainly breaks high Dpi support.

(Though not for xwayland windows which will always be scale 1)

I'll take a look at the bug, and see if we can come up with something else.

This revision now requires changes to proceed.Jul 27 2017, 4:01 PM

That almost certainly breaks high Dpi support.

That's what I feared when doing the change, though the unit test which does high dpi still works.

What we can do is check the buffer scale. If it's 1 and the clientSize is different to the bufferSize use the clientSize - in all other cases the bufferSize.

My window scaling test still works because (in retrospect) it's really stupid.

I use render an entirely blue square.

If you only show the top quarter of that it's still an entirely blue square.

I should render the Japanese flag or something to be useful. Unfortunately that means forking/extending renderAndWaitForShown.

My window scaling test still works because (in retrospect) it's really stupid.

I use render an entirely blue square.

lol, right.

If you only show the top quarter of that it's still an entirely blue square.

I should render the Japanese flag or something to be useful. Unfortunately that means forking/extending renderAndWaitForShown.

we could have an overload which takes a QImage instead of a QColor

graesslin updated this revision to Diff 17308.Jul 28 2017, 5:12 AM
graesslin edited edge metadata.

Better special casing for Xwayland case which should not break high dpi

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJul 28 2017, 5:12 AM

Seems ok, but I'm lost as to why Xwayland clients have a different buffer size in the first place.

Seems ok, but I'm lost as to why Xwayland clients have a different buffer size in the first place.

It is due to the reparenting of the window to support window decorations. The actual window becomes larger. You can find similar adjustments in the code building the vertices for OpenGL.

ok to go in?

davidedmundson accepted this revision.Aug 2 2017, 4:06 PM
This revision is now accepted and ready to land.Aug 2 2017, 4:06 PM
This revision was automatically updated to reflect the committed changes.