KWin
Loading...
Searching...
No Matches
testutils.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: 2013 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#ifndef TESTUTILS_H
10#define TESTUTILS_H
11// KWin
12#include "effect/globals.h"
13#include "effect/xcb.h"
14
15namespace
16{
17static void forceXcb()
18{
19 qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("xcb"));
20}
21}
22
23namespace KWin
24{
25
29#ifndef NO_NONE_WINDOW
30static xcb_window_t createWindow()
31{
32 xcb_window_t w = xcb_generate_id(connection());
33 const uint32_t values[] = {true};
34 xcb_create_window(connection(), 0, w, rootWindow(),
35 0, 0, 10, 10,
36 0, XCB_WINDOW_CLASS_INPUT_ONLY, XCB_COPY_FROM_PARENT,
37 XCB_CW_OVERRIDE_REDIRECT, values);
38 return w;
39}
40#endif
41
45#ifndef NO_NONE_WINDOW
46static uint32_t noneWindow()
47{
48 return XCB_WINDOW_NONE;
49}
50#endif
51
52} // namespace
53
54#endif
KWIN_EXPORT xcb_window_t rootWindow()
Definition xcb.h:24
KWIN_EXPORT xcb_connection_t * connection()
Definition xcb.h:19