Use AbstractClient instead of XdgShellClient wherever possible
ClosedPublic

Authored by zzag on Mar 2 2020, 11:11 AM.

Details

Summary

Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.

In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.

Test Plan

Existing tests pass.

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.Mar 2 2020, 11:11 AM
Restricted Application added a project: KWin. · View Herald TranscriptMar 2 2020, 11:11 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Mar 2 2020, 11:11 AM

Just to confirm as I didn't expect some of this change, the plan is still to have:

class XdgShellTopLevel: public XdgShellClient
class XdgShellPopup: public XdgShellClient

abstract_client.h
443

why does this now have to be public?

workspace.cpp
695

Can you clarify this is just a code move from the above?

It's frustrating to review these patches checking line by line as it takes a lot waaay longer than it took the developer to do the original copy paste.

zzag added a comment.Mar 2 2020, 12:00 PM

Just to confirm as I didn't expect some of this change, the plan is still to have:

class XdgShellTopLevel: public XdgShellClient
class XdgShellPopup: public XdgShellClient

Yeah, sort of...

class XdgSurfaceClient : public AbstractClient {};
class XdgToplevelClient : public XdgSurfaceClient {};
class XdgPopupClient : public XdgSurfaceClient {};

abstract_client.h
443

Otherwise, kwin won't compile. We're calling addTransient() from XdgShellClient::handleTransientForChanged().

workspace.cpp
695

It's the same.

It's frustrating to review these patches checking

Yes, I know. I squashed a lot of changes that should be separate because of the goddamn review process on Phabricator.

davidedmundson accepted this revision.Mar 2 2020, 12:00 PM
This revision is now accepted and ready to land.Mar 2 2020, 12:00 PM
This revision was automatically updated to reflect the committed changes.