Files
RedBear-OS/local/recipes/kde/kwin/source/autotests/testutils.h
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

55 lines
1.1 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef TESTUTILS_H
#define TESTUTILS_H
// KWin
#include "effect/globals.h"
#include "effect/xcb.h"
namespace
{
static void forceXcb()
{
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("xcb"));
}
}
namespace KWin
{
/**
* Wrapper to create an 0,0x10,10 input only window for testing purposes
*/
#ifndef NO_NONE_WINDOW
static xcb_window_t createWindow()
{
xcb_window_t w = xcb_generate_id(connection());
const uint32_t values[] = {true};
xcb_create_window(connection(), 0, w, rootWindow(),
0, 0, 10, 10,
0, XCB_WINDOW_CLASS_INPUT_ONLY, XCB_COPY_FROM_PARENT,
XCB_CW_OVERRIDE_REDIRECT, values);
return w;
}
#endif
/**
* casts XCB_WINDOW_NONE to uint32_t. Needed to make QCOMPARE working.
*/
#ifndef NO_NONE_WINDOW
static uint32_t noneWindow()
{
return XCB_WINDOW_NONE;
}
#endif
} // namespace
#endif