File indexing completed on 2024-02-25 17:23:55

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2006 Lubos Lunak <l.lunak@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include <netwm.h>
0013 
0014 #include "window.h"
0015 
0016 namespace KWin
0017 {
0018 
0019 class KWIN_EXPORT Unmanaged : public Window
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit Unmanaged();
0024     bool windowEvent(xcb_generic_event_t *e);
0025     bool track(xcb_window_t w);
0026     bool hasScheduledRelease() const;
0027     static void deleteUnmanaged(Unmanaged *c);
0028     int desktop() const override;
0029     QStringList activities() const override;
0030     QVector<VirtualDesktop *> desktops() const override;
0031     QPointF clientPos() const override;
0032     NET::WindowType windowType(bool direct = false, int supported_types = 0) const override;
0033     bool isOutline() const override;
0034     bool isUnmanaged() const override;
0035 
0036     QString captionNormal() const override { return {}; }
0037     QString captionSuffix() const override { return {}; }
0038     bool isCloseable() const override { return false; }
0039     bool isShown() const override { return false; }
0040     bool isHiddenInternal() const override { return false; }
0041     void hideClient() override { /* nothing to do */ }
0042     void showClient() override { /* nothing to do */ }
0043     Window *findModal(bool /*allow_itself*/) override { return nullptr; }
0044     bool isResizable() const override { return false; }
0045     bool isMovable() const override { return false; }
0046     bool isMovableAcrossScreens() const override { return false; }
0047     bool takeFocus() override { return false; }
0048     bool wantsInput() const override { return false; }
0049     void killWindow() override { /* nothing to do */ }
0050     void destroyWindow() override { /* nothing to do */ }
0051     void closeWindow() override { /* nothing to do */ }
0052     bool acceptsFocus() const override { return false; }
0053     bool belongsToSameApplication(const Window *other, SameApplicationChecks /*checks*/) const override { return other == this; }
0054     void moveResizeInternal(const QRectF & /*rect*/, KWin::Window::MoveResizeMode /*mode*/) override
0055     { /* nothing to do */
0056     }
0057     void updateCaption() override { /* nothing to do */ }
0058     QRectF resizeWithChecks(const QRectF &geometry, const QSizeF &) override
0059     { /* nothing to do */
0060         return geometry;
0061     }
0062     std::unique_ptr<WindowItem> createItem(Scene *scene) override;
0063 
0064 public Q_SLOTS:
0065     void release(ReleaseReason releaseReason = ReleaseReason::Release);
0066 
0067 private:
0068     ~Unmanaged() override; // use release()
0069     // handlers for X11 events
0070     void configureNotifyEvent(xcb_configure_notify_event_t *e);
0071     void damageNotifyEvent();
0072     QWindow *findInternalWindow() const;
0073     void checkOutput();
0074     void associate();
0075     void initialize();
0076     bool m_outline = false;
0077     bool m_scheduledRelease = false;
0078 };
0079 
0080 } // namespace