File indexing completed on 2024-02-18 16:20:19

0001 /*
0002     SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "window.h"
0010 
0011 namespace KWin
0012 {
0013 
0014 class WaylandWindow : public Window
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     WaylandWindow(KWaylandServer::SurfaceInterface *surface);
0020 
0021     QString captionNormal() const override;
0022     QString captionSuffix() const override;
0023     pid_t pid() const override;
0024     bool isClient() const override;
0025     bool isLockScreen() const override;
0026     bool isLocalhost() const override;
0027     Window *findModal(bool allow_itself = false) override;
0028     QRectF resizeWithChecks(const QRectF &geometry, const QSizeF &size) override;
0029     void killWindow() override;
0030     QString windowRole() const override;
0031     bool isShown() const override;
0032     bool isHiddenInternal() const override;
0033     void hideClient() override;
0034     void showClient() override;
0035 
0036     virtual QRectF frameRectToBufferRect(const QRectF &rect) const;
0037     bool isHidden() const;
0038 
0039     void updateDepth();
0040     void setCaption(const QString &caption);
0041 
0042 protected:
0043     bool belongsToSameApplication(const Window *other, SameApplicationChecks checks) const override;
0044     bool belongsToDesktop() const override;
0045     void doSetActive() override;
0046     void updateCaption() override;
0047     std::unique_ptr<WindowItem> createItem(Scene *scene) override;
0048 
0049     void cleanGrouping();
0050     void updateGeometry(const QRectF &rect);
0051 
0052 private:
0053     void updateClientOutputs();
0054     void updateIcon();
0055     void updateResourceName();
0056 
0057     QString m_captionNormal;
0058     QString m_captionSuffix;
0059     bool m_isHidden = false;
0060 };
0061 
0062 } // namespace KWin