QortalOS Brooklyn for Raspberry Pi 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
1.4 KiB

/*
SPDX-FileCopyrightText: 1999 Matthias Hoelzer-Kluepfel <[email protected]>
SPDX-FileCopyrightText: 2005 Lubos Lunak <[email protected]>
SPDX-FileCopyrightText: 2017 Xuetian Weng <[email protected]>
SPDX-FileCopyrightText: 2018 Roman Gilg <[email protected]>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "backends/x11/x11_backend.h"
#include <KWindowSystem/kwindowsystem.h>
#include <QFile>
#include <QGuiApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
int ret = 0;
QGuiApplication::setDesktopSettingsAware(false);
QGuiApplication app(argc, argv);
if (argc != 3)
return 1;
QString theme = QFile::decodeName(argv[1]);
QString size = QFile::decodeName(argv[2]);
if (!KWindowSystem::isPlatformX11()) {
qDebug() << "X11 backend not detected. Exit.";
return 2;
}
X11Backend *backend = X11Backend::implementation();
if (!backend->isValid()) {
return 2;
}
// Note: If you update this code, update main.cpp as well.
// use a default value for theme only if it's not configured at all, not even in X resources
if (theme.isEmpty() && backend->currentCursorTheme().isEmpty()) {
theme = "breeze_cursors";
ret = 10; // means to switch to default
}
backend->applyCursorTheme(theme, size.toInt());
delete backend;
return ret;
}