Fix maximize Apply Now rule
ClosedPublic

Authored by zzag on Jul 3 2019, 8:40 PM.

Details

Summary

AbstractClient applies maximize rules by running

maximize(maximizeMode());

but because window rules are checked only in changeMaximize
implementation, the if statement prevents us from applying maximize
rules (m and maximizeMode() are equal).

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.
zzag created this revision.Jul 3 2019, 8:40 PM
Restricted Application added a project: KWin. · View Herald TranscriptJul 3 2019, 8:40 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jul 3 2019, 8:40 PM
romangg accepted this revision.Jul 8 2019, 8:21 AM
romangg added a subscriber: romangg.

That we need this conditional removed indicates that the structure is wrong how we check for the maximize rule. And looking at the code we have methods maximize, setMaximize and changeMaximize in quick succession. I'm pretty sure we could remove at least one of these three.

Nevertheless let's get this in as a quick fix.

This revision is now accepted and ready to land.Jul 8 2019, 8:21 AM
zzag added a comment.Jul 8 2019, 8:27 AM

That we need this conditional removed indicates that the structure is wrong how we check for the maximize rule. And looking at the code we have methods maximize, setMaximize and changeMaximize in quick succession. I'm pretty sure we could remove at least one of these three.

maximize is just a wrapper around setMaximize, another name for changeMaximize is doMaximize (a better one).

zzag updated this revision to Diff 61315.Jul 8 2019, 8:58 AM

Argh, it's sort of embarassing but I forgot to include one vital change
in ShellClient::changeMaximize.

We need to move the guard from AbstractClient::maximize to ShellClient::
changeMaximize, otherwise test suite will be red-ish.

Client::changeMaximize already contains that guard.

romangg accepted this revision.Jul 8 2019, 9:15 AM
This revision was automatically updated to reflect the committed changes.