KWin
Loading...
Searching...
No Matches
xcb.h
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: 2006 Lubos Lunak <l.lunak@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9
10#pragma once
11
12#include <QGuiApplication>
13#include <kwin_export.h>
14#include <xcb/xcb.h>
15
16namespace KWin
17{
18
19inline KWIN_EXPORT xcb_connection_t *connection()
20{
21 return reinterpret_cast<xcb_connection_t *>(qApp->property("x11Connection").value<void *>());
22}
23
24inline KWIN_EXPORT xcb_window_t rootWindow()
25{
26 return qApp->property("x11RootWindow").value<quint32>();
27}
28
29inline KWIN_EXPORT xcb_timestamp_t xTime()
30{
31 return qApp->property("x11Time").value<xcb_timestamp_t>();
32}
33
34void KWIN_EXPORT grabXServer();
35void KWIN_EXPORT ungrabXServer();
36bool KWIN_EXPORT grabXKeyboard(xcb_window_t w = XCB_WINDOW_NONE);
37void KWIN_EXPORT ungrabXKeyboard();
38
45{
46public:
48 {
50 }
52 {
54 }
55};
56
57}
KWIN_EXPORT xcb_window_t rootWindow()
Definition xcb.h:24
KWIN_EXPORT xcb_timestamp_t xTime()
Definition xcb.h:29
KWIN_EXPORT xcb_connection_t * connection()
Definition xcb.h:19
void KWIN_EXPORT ungrabXKeyboard()
Definition common.cpp:121
void KWIN_EXPORT grabXServer()
Definition common.cpp:72
void KWIN_EXPORT ungrabXServer()
Definition common.cpp:79
bool KWIN_EXPORT grabXKeyboard(xcb_window_t w=XCB_WINDOW_NONE)
Definition common.cpp:90