Handle XdgShell window geometry in configure request sizes
ClosedPublic

Authored by davidedmundson on May 1 2019, 1:46 PM.

Details

Summary

The size passed to an XDG shell configure request should match the
window size of the given window, we don't want to include the size of
any shadows that may be drawn by the client.

Kwin has the same concept of geometry for both window management, input
and rendering.

In order to approach this in a way that does not risk any regressions
with kwin's current structure AbstractClient::geometry remains the
canonical source and we handle the window within that internally within
ShellClient treating the windowGeometry as a set of margins from this.

This is part of a much bigger task (T10867). This patch addresses
windows growing when starting a drag based resize.

BUG: 403376

Test Plan

Unit test
gtk3-demo

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.May 1 2019, 1:46 PM
Restricted Application added a project: KWin. · View Herald TranscriptMay 1 2019, 1:46 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.May 1 2019, 1:46 PM
davidedmundson retitled this revision from Handle XdgWindowGeometry in configure request sizes to Handle XdgShell window geometry in configure request sizes.May 1 2019, 2:19 PM

Reword a change

zzag added a subscriber: zzag.May 3 2019, 4:24 PM
zzag added inline comments.
autotests/integration/shell_client_test.cpp
1484

Please wrap in QVERIFY.

Also, would it be a good idea to have an explicit configureRequestedSpy.wait() right after renderAndWaitFotShown?

1489

No whitespace before comma.

1492–1493

If we add support for window rules, would geometry rules work well with GTK+ clients?

davidedmundson added inline comments.May 4 2019, 10:12 AM
autotests/integration/shell_client_test.cpp
1484

Adding there is a slightly tricky case, the configure event after renderAndWaitForShown is just kwin activating the window. Something that happens with current kwin, but not a requirement that we want to be testing. I'll add it with a comment and not qverify it.

1492–1493

Before this patch: No
After this patch: Also no, but support will become easier to add.

The attached task hopefully lists plans. I can expand on any rationale/details there.

zzag added inline comments.May 4 2019, 10:24 AM
autotests/integration/shell_client_test.cpp
1492–1493

Hmm, maybe I don't have full insight.

If there is a remember size rule and the last window size is (500, 500) and the actual last client size is (600, 600), we would send (600, 600) in the initial configure event, right? Shouldn't we send (500, 500) instead?

davidedmundson planned changes to this revision.May 4 2019, 10:34 AM
This comment was removed by davidedmundson.
zzag added inline comments.May 4 2019, 10:35 AM
autotests/integration/shell_client_test.cpp
1492–1493

Argh, nevermind. Just saw

Adjust rules

in the attached task.

zzag accepted this revision.May 10 2019, 3:11 PM
zzag added inline comments.
shell_client.cpp
1904–1906

Please align them.

This revision is now accepted and ready to land.May 10 2019, 3:11 PM
This revision was automatically updated to reflect the committed changes.