File indexing completed on 2024-04-21 09:21:05

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(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 
0032     virtual QRectF frameRectToBufferRect(const QRectF &rect) const;
0033 
0034     void setCaption(const QString &caption);
0035 
0036 protected:
0037     bool belongsToSameApplication(const Window *other, SameApplicationChecks checks) const override;
0038     bool belongsToDesktop() const override;
0039     void doSetActive() override;
0040     void updateCaption() override;
0041     void updateClientOutputs();
0042     std::unique_ptr<WindowItem> createItem(Scene *scene) override;
0043 
0044     void cleanGrouping();
0045     void updateGeometry(const QRectF &rect);
0046     void markAsMapped();
0047 
0048 private:
0049     void updateIcon();
0050     void updateResourceName();
0051 
0052     QString m_captionNormal;
0053     QString m_captionSuffix;
0054     bool m_isScreenLocker = false;
0055 };
0056 
0057 } // namespace KWin