File indexing completed on 2025-04-27 11:32:59

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     SPDX-FileCopyrightText: 2010, 2011, 2017 Martin Gräßlin <mgraesslin@kde.org>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 #pragma once
0011 
0012 #include "effects.h"
0013 #include "utils/xcbutils.h"
0014 
0015 #include <memory.h>
0016 
0017 namespace KWin
0018 {
0019 class EffectsMouseInterceptionX11Filter;
0020 class EffectsKeyboardInterceptionX11Filter;
0021 
0022 class EffectsHandlerImplX11 : public EffectsHandlerImpl
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit EffectsHandlerImplX11(Compositor *compositor, WorkspaceScene *scene);
0027     ~EffectsHandlerImplX11() override;
0028 
0029     void defineCursor(Qt::CursorShape shape) override;
0030 
0031 protected:
0032     bool doGrabKeyboard() override;
0033     void doUngrabKeyboard() override;
0034 
0035     void doStartMouseInterception(Qt::CursorShape shape) override;
0036     void doStopMouseInterception() override;
0037 
0038     void doCheckInputWindowStacking() override;
0039 
0040 private:
0041     Xcb::Window m_mouseInterceptionWindow;
0042     std::unique_ptr<EffectsMouseInterceptionX11Filter> m_x11MouseInterception;
0043     std::unique_ptr<EffectsKeyboardInterceptionX11Filter> m_x11KeyboardInterception;
0044 };
0045 
0046 }