2020-02-17 18:39:17 +00:00
|
|
|
/*
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2020-02-17 18:39:17 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "abstract_client.h"
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2020-08-21 06:58:24 +00:00
|
|
|
enum class SyncMode {
|
|
|
|
Sync,
|
|
|
|
Async,
|
|
|
|
};
|
|
|
|
|
2020-02-17 18:39:17 +00:00
|
|
|
class WaylandClient : public AbstractClient
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
WaylandClient(KWaylandServer::SurfaceInterface *surface);
|
|
|
|
|
2020-08-18 12:51:20 +00:00
|
|
|
QRect bufferGeometry() const override;
|
2020-02-17 18:39:17 +00:00
|
|
|
QString captionNormal() const override;
|
|
|
|
QString captionSuffix() const override;
|
|
|
|
QStringList activities() const override;
|
|
|
|
void setOnAllActivities(bool set) override;
|
|
|
|
void blockActivityUpdates(bool b = true) override;
|
|
|
|
QPoint clientContentPos() const override;
|
|
|
|
QRect transparentRect() const override;
|
|
|
|
pid_t pid() const override;
|
|
|
|
bool isLockScreen() const override;
|
|
|
|
bool isLocalhost() const override;
|
2021-02-05 21:56:17 +00:00
|
|
|
qreal opacity() const override;
|
|
|
|
void setOpacity(qreal opacity) override;
|
2020-02-17 18:39:17 +00:00
|
|
|
AbstractClient *findModal(bool allow_itself = false) override;
|
|
|
|
void resizeWithChecks(const QSize &size, ForceGeometry_t force = NormalGeometrySet) override;
|
2020-08-18 12:51:20 +00:00
|
|
|
void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet) override;
|
|
|
|
using AbstractClient::move;
|
|
|
|
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) override;
|
2020-02-17 18:39:17 +00:00
|
|
|
void killWindow() override;
|
|
|
|
QByteArray windowRole() const override;
|
2020-08-17 08:24:18 +00:00
|
|
|
bool isShown(bool shaded_is_shown) const override;
|
|
|
|
bool isHiddenInternal() const override;
|
|
|
|
void hideClient(bool hide) override;
|
|
|
|
|
2020-08-18 12:51:20 +00:00
|
|
|
virtual QRect frameRectToBufferRect(const QRect &rect) const;
|
|
|
|
QRect requestedFrameGeometry() const;
|
|
|
|
QPoint requestedPos() const;
|
|
|
|
QSize requestedSize() const;
|
|
|
|
QRect requestedClientGeometry() const;
|
|
|
|
QSize requestedClientSize() const;
|
2020-08-17 08:24:18 +00:00
|
|
|
bool isHidden() const;
|
2020-02-17 18:39:17 +00:00
|
|
|
|
2020-07-29 16:39:47 +00:00
|
|
|
void updateDepth();
|
2020-02-17 18:39:17 +00:00
|
|
|
void setCaption(const QString &caption);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override;
|
|
|
|
bool belongsToDesktop() const override;
|
|
|
|
void doSetActive() override;
|
|
|
|
void updateCaption() override;
|
|
|
|
|
2020-08-21 06:58:24 +00:00
|
|
|
void setPositionSyncMode(SyncMode syncMode);
|
|
|
|
void setSizeSyncMode(SyncMode syncMode);
|
2020-08-19 08:01:33 +00:00
|
|
|
void cleanGrouping();
|
2020-09-03 10:10:19 +00:00
|
|
|
void cleanTabBox();
|
2020-08-19 08:01:33 +00:00
|
|
|
|
2020-08-18 12:51:20 +00:00
|
|
|
virtual void requestGeometry(const QRect &rect);
|
|
|
|
virtual void updateGeometry(const QRect &rect);
|
|
|
|
|
2020-02-17 18:39:17 +00:00
|
|
|
private:
|
|
|
|
void updateClientOutputs();
|
|
|
|
void updateIcon();
|
|
|
|
void updateResourceName();
|
2020-08-17 08:24:18 +00:00
|
|
|
void internalShow();
|
|
|
|
void internalHide();
|
2020-02-17 18:39:17 +00:00
|
|
|
|
|
|
|
QString m_captionNormal;
|
|
|
|
QString m_captionSuffix;
|
2021-02-05 21:56:17 +00:00
|
|
|
qreal m_opacity = 1.0;
|
2020-08-18 12:51:20 +00:00
|
|
|
QRect m_requestedFrameGeometry;
|
|
|
|
QRect m_bufferGeometry;
|
|
|
|
QRect m_requestedClientGeometry;
|
2020-08-21 06:58:24 +00:00
|
|
|
SyncMode m_positionSyncMode = SyncMode::Sync;
|
|
|
|
SyncMode m_sizeSyncMode = SyncMode::Sync;
|
2020-08-17 08:24:18 +00:00
|
|
|
bool m_isHidden = false;
|
2020-02-17 18:39:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|