kwin/src/lidswitchtracker.h
Xaver Hugl f60bcfb646 handle laptop lid closing in KWin
Instead of KScreen turning the display off, do that in KWin directly
2023-05-09 15:18:33 +00:00

34 lines
566 B
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "input_event_spy.h"
#include <QObject>
namespace KWin
{
class LidSwitchTracker : public QObject, InputEventSpy
{
Q_OBJECT
public:
explicit LidSwitchTracker();
bool isLidClosed() const;
Q_SIGNALS:
void lidStateChanged();
private:
void switchEvent(KWin::SwitchEvent *event) override;
bool m_isLidClosed = false;
};
}