Remove overloads on virtual methods
ClosedPublic

Authored by apol on Wed, Mar 25, 3:15 PM.

Details

Summary

Prefer virtual methods that take QRect and QSize rather than multi-int versions.
Makes for clearer API and reduces the amount of code that was taking all of the
components and turn it into a class.

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.
apol created this revision.Wed, Mar 25, 3:15 PM
Restricted Application added a project: KWin. · View Herald TranscriptWed, Mar 25, 3:15 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
apol requested review of this revision.Wed, Mar 25, 3:15 PM
zzag added a subscriber: zzag.EditedWed, Mar 25, 4:22 PM

What I had back in my mind was to introduce eventually something like requestedClientGeometry(), requestedFrameGeometry(), and doSetGeometry() in AbstractClient. It would allow us to get rid of the force parameter, merge code that forces shaded geometry, and un-virtualize setFrameGeometry(), but code refactoring in this patch is also fine.

I have a few nitpicks, could you please address them before I click "Accept Revision"?

internal_client.cpp
309

I don't like that the QRect type is erased. IMHO, it reduces readability. What about being explicit?

setFrameGeometry(QRect(pos(), size.boundedTo(area.size()), force);

It's a bit longer, but imho more readable.

x11client.cpp
4183

s/_frameGeometry/rect/

apol updated this revision to Diff 78509.Thu, Mar 26, 12:14 AM
apol marked an inline comment as done.

Address Vlad's comments

apol marked an inline comment as done.Thu, Mar 26, 12:29 AM
zzag accepted this revision.Thu, Mar 26, 8:06 AM
zzag added inline comments.
abstract_client.cpp
713

I'd swap size() and area.size() so when the code is read by someone it's easier to understand what we do.

This revision is now accepted and ready to land.Thu, Mar 26, 8:06 AM
This revision was automatically updated to reflect the committed changes.