Refactor geometry constraints code
Needs ReviewPublic

Authored by zzag on Jan 22 2020, 9:42 AM.


Group Reviewers

Currently, there are a couple of issues with sizeForClientSize(). First
of all, we have a method called clientSizeToFrameSize() which does similar
thing except applying geometry constraints and checking window rules. The
other issue is that sizeForClientSize() is doing a bit too much, it checks
window rules, it applies a bunch of geometry constrains. Sometimes it
does not perform conversion between client sizes and frame sizes!

This change attempts to address those issues by replacing sizeForClientSize
with two similar methods and changing semantics of some methods of the
X11Client class.

The most significant difference between sizeForClientSize() and the new
methods is that neither constrainClientSize() nor constrainFrameSize()
check window rules. This is up to users of those methods. In many places,
we don't have to check window rules because we check isResizable(),
which returns false if the frame size is enforced by a window rule.

Diff Detail

R108 KWin
Lint SkippedExcuse: foo
No Unit Test Coverage
Build Status
Buildable 22470
Build 22488: arc lint + arc unit
zzag created this revision.Jan 22 2020, 9:42 AM
Restricted Application added a project: KWin. · View Herald TranscriptJan 22 2020, 9:42 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jan 22 2020, 9:42 AM
zzag added a comment.Thu, Jan 30, 12:16 PM

If there are no objections, I'm going to land this patch (and other patches that depend on it) in about a week.

zzag updated this revision to Diff 75659.Fri, Feb 14, 8:02 AM


zzag updated this revision to Diff 75666.Fri, Feb 14, 8:28 AM

Delete unrelated changes in X11Client::setFrameGeometry and X11Client::plainResize.