Done in one step as it requires changes which are better suited with a
QApplication.
To not need to parte the QCommandLineParser around the needed arguments
are added to the KWin::Application through setters and the crash count
is available through a static getter/setter pair.
In case that the window operation results in destroying the window
decoration we need to have the menu closed before the deco gets
destroyed. Otherwise Qt crashes.
* Ported away from KAction
* starting the dialog is moved into a thread
Currently this code is still rather crashy as destroying the deco
seems to somehow crash KWin in the interaction.
Wrapped in xcbutils.
In addition the check whether another WM is running in main.cpp is
improved by doing a checked request and directly checking for the
error. If there is an error, KWin puts out an error message and
quits.
* KApplication -> QApplication
* Qt::escape -> QString::toHtmlEscaped
* KDebug -> QDebug
In addition it uses KMessageBox::warningContinueCancelWId from
KInterProcessWindowing as we have the window id.
KCmdLineArgs is still used as the replacement is still in
kdeqt5staging.
Requires 9c45260942c0ee32267e651d981bfa33a6acb64d from qtx11extras.
Note: this does not fully replace the functionality which we used to
have. The event queue is not yet searched for the first even with a
timestamp.
The DBusCall is exported as a QObject to the QML environment. It is
intended as a declarative replacement for the callDBus method which used
to be exported on global scope in the QtQuick 1 world.
Example usage:
DBusCall {
id: dbus
service: "org.kde.KWin"
path: "/KWin"
method: "setCurrentDesktop"
arguments: [1]
Component.onCompleted: dbus.call()
}
Getting all functionality from old solution into new one is not really
possible. Main problems are that QtScript provided more functionality
than the QJSEngine. For example it's no longer possible to just export
functions to the engine. We need to have a Qt wrapper object. At the
moment this wrapper object doesn't export all functions as the callbacks
are tricky. A solution might be to create specific QML types
encapsulating functionality which used to be exported on the functions.
Nevertheless a basic QML script loads and works and the ported readConfig
function works, too.