KWin
Loading...
Searching...
No Matches
hide_cursor_spy.cpp
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2018 Martin Flöser <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#include "hide_cursor_spy.h"
10#include "cursor.h"
11#include "input_event.h"
12#include "main.h"
13
14namespace KWin
15{
16
18{
19 showCursor();
20}
21
23{
24 showCursor();
25}
26
27void HideCursorSpy::touchDown(qint32 id, const QPointF &pos, std::chrono::microseconds time)
28{
29 hideCursor();
30}
31
33{
34 if (event->type() == QEvent::Type::TabletLeaveProximity) {
35 hideCursor();
36 } else {
37 showCursor();
38 }
39}
40
41void HideCursorSpy::showCursor()
42{
43 if (!m_cursorHidden) {
44 return;
45 }
46 m_cursorHidden = false;
48}
49
50void HideCursorSpy::hideCursor()
51{
52 if (m_cursorHidden) {
53 return;
54 }
55 m_cursorHidden = true;
57}
58
59}
void hideCursor()
Definition cursor.cpp:69
static Cursors * self()
Definition cursor.cpp:35
void showCursor()
Definition cursor.cpp:77
void touchDown(qint32 id, const QPointF &pos, std::chrono::microseconds time) override
void wheelEvent(KWin::WheelEvent *event) override
void pointerEvent(KWin::MouseEvent *event) override
void tabletToolEvent(TabletEvent *event) override