Add support for resize only borders on Wayland
ClosedPublic

Authored by graesslin on Sep 15 2016, 9:48 AM.

Details

Summary

This change adds support for resizing outside the window decoration
(e.g. setting borders to NoSide or None).

To support this a new Toplevel::inputGeometry() -> QRect method is
added which exposes the geometry adjusted by the margins provided by
the decoration. This is checked in InputRedirection when finding a
Toplevel at a given position. The logic for figuring out whether the
event should go to the decoration or the window already handled the
situation correctly, so no further changes are needed.

BUG: 364607

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 updated this revision to Diff 6756.Sep 15 2016, 9:48 AM
graesslin retitled this revision from to Add support for resize only borders on Wayland.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptSep 15 2016, 9:48 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
luebking added inline comments.
abstract_client.cpp
1634

spare this test and just

return TopLevel::inputGeometry() + decoration()->resizeOnlyBorders();

resp. even (more controlled, geometry() isn't virtual, but it depends on what you really need here)

return geometry() + decoration()->resizeOnlyBorders();

?

graesslin marked an inline comment as done.Sep 16 2016, 7:09 AM
graesslin updated this revision to Diff 6770.Sep 16 2016, 7:10 AM

simplified

sebas added a subscriber: sebas.Oct 4 2016, 2:14 PM
sebas added inline comments.
autotests/integration/decoration_input_test.cpp
514

Top edge? Also, what about the corners?

522

I don't see any call to QStandardPaths::setTestModeEnabled(...), are you overwriting the user's config here?

http://doc.qt.io/qt-5/qstandardpaths.html#setTestModeEnabled

551

TopEdge missing?

graesslin added inline comments.Oct 4 2016, 2:29 PM
autotests/integration/decoration_input_test.cpp
514

Top edge doesn't support this in breeze. That's why it's not set. The idea is to provide resize borders if there is no border at all. But the top still has the window title and buttons, so there is a resize area already.

Corner I didn't include as it would make the test way more complicated (would need to pass flags around and then calculate the positions) while we don't gain much for it. What's important is that the areas are properly handled and that's tested.

522

Please see line 132ff. We are using an in-memory KConfigPtr.

551

See above. It's not supported for TopEdge.

Hi,

from usability point the existing border size is semi optimal, cause you change the border size and than you have to change the text size to see a difference.

it would be very usefull that when you change the border size, the text size change automatical or at least you can change the text size in the same kcm.

Hi,

from usability point the existing border size is semi optimal, cause you change the border size and than you have to change the text size to see a difference.

it would be very usefull that when you change the border size, the text size change automatical or at least you can change the text size in the same kcm.

Why should the text size change? The settings are quite clear, it's either no border or no side border. The top area is not a border and given that not affected by the settings. If that is not obvious we need to improve the help.

also could we please stay on topic - this is about restoring functionality on Wayland as 1:1 as how it works on X11. Let's not derail it into a discussion about completely unrelated things.

sebas accepted this revision.Oct 4 2016, 3:27 PM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Oct 4 2016, 3:27 PM
This revision was automatically updated to reflect the committed changes.