KWin
Loading...
Searching...
No Matches
x11_standalone_sgivideosyncvsyncmonitor.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
10
11#include <epoxy/glx.h>
12#include <fixx11h.h>
13
14#include <QThread>
15
16namespace KWin
17{
18
23class SGIVideoSyncVsyncMonitorHelper : public QObject
24{
25 Q_OBJECT
26
27public:
30
31 bool isValid() const;
32
33public Q_SLOTS:
34 void poll();
35
36Q_SIGNALS:
38 void vblankOccurred(std::chrono::nanoseconds timestamp);
39
40private:
41 ::Display *m_display = nullptr;
42 ::Window m_dummyWindow = 0;
43 GLXContext m_localContext = 0;
44 GLXDrawable m_drawable = 0;
45};
46
56{
57 Q_OBJECT
58
59public:
60 static std::unique_ptr<SGIVideoSyncVsyncMonitor> create();
62
63 bool isValid() const;
64
65public Q_SLOTS:
66 void arm() override;
67
68private:
69 explicit SGIVideoSyncVsyncMonitor();
70
71 QThread m_thread;
73};
74
75} // namespace KWin
void vblankOccurred(std::chrono::nanoseconds timestamp)
static std::unique_ptr< SGIVideoSyncVsyncMonitor > create()
struct _XDisplay Display