mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Implementation of a popup button to rotate the screen while using gesture navigation. The button is set to appear when the device rotates while auto rotation is off. Then the button will be visible for a short period of time before disappearing.
34 lines
961 B
C++
34 lines
961 B
C++
/*
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "taskpanel.h"
|
|
|
|
#include <QDBusConnection>
|
|
#include <QDBusPendingReply>
|
|
#include <QDebug>
|
|
#include <QGuiApplication>
|
|
|
|
// register type for Keyboards.KWinVirtualKeyboard.forceActivate();
|
|
Q_DECLARE_METATYPE(QDBusPendingReply<>)
|
|
|
|
TaskPanel::TaskPanel(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
|
|
: Plasma::Containment(parent, data, args)
|
|
{
|
|
|
|
}
|
|
|
|
void TaskPanel::triggerTaskSwitcher() const
|
|
{
|
|
QDBusMessage message = QDBusMessage::createMethodCall("org.kde.kglobalaccel", "/component/kwin", "org.kde.kglobalaccel.Component", "invokeShortcut");
|
|
message.setArguments({QStringLiteral("Mobile Task Switcher")});
|
|
|
|
// this does not block, so it won't necessarily be called before the method returns
|
|
QDBusConnection::sessionBus().send(message);
|
|
}
|
|
|
|
K_PLUGIN_CLASS(TaskPanel)
|
|
|
|
#include "taskpanel.moc"
|