kwin/src/effects/outputlocator/outputlocator.h
David Redondo 6576a83aee Add outputlocator effect
An effect that implements the "identify" functionality of
the screen configuration kcm. It displays a label on each
screen that identifies the screen.
Doing this as a kwin effect allows to correctly handle
the case when outputs are mirrored (on wayland) compared to
absolute positioning of windows which end up on top of each other.
2022-07-20 07:01:05 +00:00

37 lines
772 B
C++

/*
SPDX-FileCopyrightText: 2022 David Redondo <kde@david-redondo.de>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#pragma once
#include <kwineffects.h>
#include <QTimer>
#include <QWindow>
namespace KWin
{
class OffscreenQuickScene;
class OutputLocatorEffect : public KWin::Effect
{
Q_OBJECT
public:
explicit OutputLocatorEffect(QObject *parent = nullptr);
void paintScreen(int mask, const QRegion &region, KWin::ScreenPaintData &data) override;
bool isActive() const override;
public Q_SLOTS:
void show();
void hide();
private:
QUrl m_qmlUrl;
QTimer m_showTimer;
std::unique_ptr<QWindow> m_dummyWindow;
QMap<EffectScreen *, OffscreenQuickScene *> m_scenesByScreens;
};
}