Cleanup XdgShellClient header

Don't put method definitions in the header file of XdgShellClient class
as it makes the code visually inconsistent. InternalClient is a good
example of how the header file of a subclass of AbstractClient class
should look like.

This change also cleans up the order of things in the header file, thus
making it a bit more obvious where new things should go.
This commit is contained in:
Vlad Zahorodnii 2019-09-15 12:41:21 +03:00
parent e0711e3c43
commit f67db3a918
2 changed files with 56 additions and 54 deletions

View file

@ -694,6 +694,16 @@ void XdgShellClient::blockActivityUpdates(bool b)
Q_UNUSED(b)
}
QString XdgShellClient::captionNormal() const
{
return m_caption;
}
QString XdgShellClient::captionSuffix() const
{
return m_captionSuffix;
}
void XdgShellClient::updateCaption()
{
const QString oldSuffix = m_captionSuffix;
@ -809,6 +819,11 @@ bool XdgShellClient::isShown(bool shaded_is_shown) const
return !m_closing && !m_unmapped && !isMinimized() && !m_hidden;
}
bool XdgShellClient::isHiddenInternal() const
{
return m_unmapped || m_hidden;
}
void XdgShellClient::hideClient(bool hide)
{
if (m_hidden == hide) {
@ -926,6 +941,11 @@ void XdgShellClient::changeMaximize(bool horizontal, bool vertical, bool adjust)
}
}
void XdgShellClient::setGeometryRestore(const QRect &geo)
{
m_geomMaximizeRestore = geo;
}
MaximizeMode XdgShellClient::maximizeMode() const
{
return m_maximizeMode;
@ -936,6 +956,11 @@ MaximizeMode XdgShellClient::requestedMaximizeMode() const
return m_requestedMaximizeMode;
}
QRect XdgShellClient::geometryRestore() const
{
return m_geomMaximizeRestore;
}
bool XdgShellClient::noBorder() const
{
if (m_serverDecoration) {
@ -1451,6 +1476,11 @@ bool XdgShellClient::hasStrut() const
return m_plasmaShellSurface->panelBehavior() == PlasmaShellSurfaceInterface::PanelBehavior::AlwaysVisible;
}
quint32 XdgShellClient::windowId() const
{
return m_windowId;
}
void XdgShellClient::updateIcon()
{
const QString waylandIconName = QStringLiteral("wayland");
@ -1819,6 +1849,11 @@ void XdgShellClient::killWindow()
QTimer::singleShot(5000, c, &ClientConnection::destroy);
}
bool XdgShellClient::isLocalhost() const
{
return true;
}
bool XdgShellClient::hasPopupGrab() const
{
return m_hasPopupGrab;

View file

@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "abstract_client.h"
#include <KWayland/Server/xdgshell_interface.h>
namespace KWayland
@ -51,6 +52,7 @@ enum class PingReason {
class KWIN_EXPORT XdgShellClient : public AbstractClient
{
Q_OBJECT
public:
XdgShellClient(KWayland::Server::XdgShellSurfaceInterface *surface);
XdgShellClient(KWayland::Server::XdgShellPopupInterface *surface);
@ -65,14 +67,9 @@ public:
double opacity() const override;
void setOpacity(double opacity) override;
QByteArray windowRole() const override;
void blockActivityUpdates(bool b = true) override;
QString captionNormal() const override {
return m_caption;
}
QString captionSuffix() const override {
return m_captionSuffix;
}
QString captionNormal() const override;
QString captionSuffix() const override;
void closeWindow() override;
AbstractClient *findModal(bool allow_itself = false) override;
bool isCloseable() const override;
@ -84,16 +81,11 @@ public:
bool isMovableAcrossScreens() const override;
bool isResizable() const override;
bool isShown(bool shaded_is_shown) const override;
bool isHiddenInternal() const override {
return m_unmapped || m_hidden;
}
bool isHiddenInternal() const override;
void hideClient(bool hide) override;
MaximizeMode maximizeMode() const override;
MaximizeMode requestedMaximizeMode() const override;
QRect geometryRestore() const override {
return m_geomMaximizeRestore;
}
QRect geometryRestore() const override;
bool noBorder() const override;
void setFullScreen(bool set, bool user = true) override;
void setNoBorder(bool set) override;
@ -109,21 +101,23 @@ public:
using AbstractClient::setGeometry;
void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
bool hasStrut() const override;
quint32 windowId() const override {
return m_windowId;
}
/**
* The process for this client.
* Note that processes started by kwin will share its process id.
* @since 5.11
* @returns the process if for this client.
*/
quint32 windowId() const override;
pid_t pid() const override;
bool isLockScreen() const override;
bool isInputMethod() const override;
bool isInitialPositionSet() const override;
bool isTransient() const override;
bool hasTransientPlacementHint() const override;
QRect transientPlacement(const QRect &bounds) const override;
QMatrix4x4 inputTransformation() const override;
void showOnScreenEdge() override;
bool hasPopupGrab() const override;
void popupDone() override;
void updateColorScheme() override;
bool isPopupWindow() const override;
void killWindow() override;
bool isLocalhost() const override;
bool supportsWindowRules() const override;
void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface);
void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration);
@ -131,33 +125,8 @@ public:
void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette);
void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration);
bool isInitialPositionSet() const override;
bool isTransient() const override;
bool hasTransientPlacementHint() const override;
QRect transientPlacement(const QRect &bounds) const override;
QMatrix4x4 inputTransformation() const override;
void showOnScreenEdge() override;
void killWindow() override;
void placeIn(const QRect &area);
bool hasPopupGrab() const override;
void popupDone() override;
void updateColorScheme() override;
bool isPopupWindow() const override;
bool isLocalhost() const override
{
return true;
}
bool supportsWindowRules() const override;
protected:
void addDamage(const QRegion &damage) override;
bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override;
@ -165,9 +134,7 @@ protected:
bool belongsToDesktop() const override;
Layer layerForDock() const override;
void changeMaximize(bool horizontal, bool vertical, bool adjust) override;
void setGeometryRestore(const QRect &geo) override {
m_geomMaximizeRestore = geo;
}
void setGeometryRestore(const QRect &geo) override;
void doResizeSync() override;
bool acceptsFocus() const override;
void doMinimize() override;