mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Overlay the shell's status panel and quicksettings panel over the lockscreen, instead of rendering a second copy in the lockscreen theme. This will allow us to improve the lockscreen loading speed. Key changes: - Overlay quicksettings window and the status bar over the lockscreen when it is shown - Refactor the top panel's showing logic to be cleaner (as it supports various overlay modes over fullscreen apps already) - Implement lockscreen support to the status bar and quicksettings panel in the to panel - Forward quicksettings panel requests for "unlock" over DBus to the lockscreen - Add "raiselockscreen" QML plugin to easily request a window to be raised over the lockscreen Notes: - Now that we are sharing the quicksettings panel from the shell, notifications that are already there will be shown on the lockscreen (compared to right now, where only new notifications would be shown) Depends on: - https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2339 - https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/283 - https://invent.kde.org/plasma/kwin/-/merge_requests/7839 Implements: https://invent.kde.org/plasma/plasma-mobile/-/issues/199 
157 lines
3.6 KiB
C++
157 lines
3.6 KiB
C++
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "shelldbusobject.h"
|
|
#include "mobileadaptor.h"
|
|
|
|
#include <QDBusConnection>
|
|
|
|
ShellDBusObject::ShellDBusObject(QObject *parent)
|
|
: QObject{parent}
|
|
, m_startupFeedbackModel{new StartupFeedbackModel{this}}
|
|
{
|
|
}
|
|
|
|
void ShellDBusObject::registerObject()
|
|
{
|
|
if (!m_initialized) {
|
|
new PlasmashellAdaptor{this};
|
|
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Mobile"), this);
|
|
m_initialized = true;
|
|
}
|
|
}
|
|
|
|
StartupFeedbackModel *ShellDBusObject::startupFeedbackModel()
|
|
{
|
|
return m_startupFeedbackModel;
|
|
}
|
|
|
|
bool ShellDBusObject::doNotDisturb()
|
|
{
|
|
return m_doNotDisturb;
|
|
}
|
|
|
|
void ShellDBusObject::setDoNotDisturb(bool value)
|
|
{
|
|
if (value != m_doNotDisturb) {
|
|
m_doNotDisturb = value;
|
|
Q_EMIT doNotDisturbChanged();
|
|
}
|
|
}
|
|
|
|
QString ShellDBusObject::panelState()
|
|
{
|
|
return m_panelState;
|
|
}
|
|
|
|
void ShellDBusObject::setPanelState(QString state)
|
|
{
|
|
if (state != m_panelState) {
|
|
m_panelState = state;
|
|
Q_EMIT panelStateChanged();
|
|
}
|
|
}
|
|
|
|
|
|
bool ShellDBusObject::isActionDrawerOpen()
|
|
{
|
|
return m_isActionDrawerOpen;
|
|
}
|
|
|
|
void ShellDBusObject::setIsActionDrawerOpen(bool value)
|
|
{
|
|
if (value != m_isActionDrawerOpen) {
|
|
m_isActionDrawerOpen = value;
|
|
Q_EMIT isActionDrawerOpenChanged();
|
|
}
|
|
}
|
|
|
|
bool ShellDBusObject::isVolumeOSDOpen()
|
|
{
|
|
return m_isVolumeOSDOpen;
|
|
}
|
|
|
|
void ShellDBusObject::setIsVolumeOSDOpen(bool value)
|
|
{
|
|
if (value != m_isVolumeOSDOpen) {
|
|
m_isVolumeOSDOpen = value;
|
|
Q_EMIT isVolumeOSDOpenChanged();
|
|
}
|
|
}
|
|
|
|
bool ShellDBusObject::isNotificationPopupDrawerOpen()
|
|
{
|
|
return m_isNotificationPopupDrawerOpen;
|
|
}
|
|
|
|
void ShellDBusObject::setIsNotificationPopupDrawerOpen(bool value)
|
|
{
|
|
if (value != m_isNotificationPopupDrawerOpen) {
|
|
m_isNotificationPopupDrawerOpen = value;
|
|
Q_EMIT isNotificationPopupDrawerOpenChanged();
|
|
}
|
|
}
|
|
|
|
bool ShellDBusObject::isTaskSwitcherVisible()
|
|
{
|
|
return m_isTaskSwitcherVisible;
|
|
}
|
|
|
|
void ShellDBusObject::setIsTaskSwitcherVisible(bool value)
|
|
{
|
|
if (value != m_isTaskSwitcherVisible) {
|
|
m_isTaskSwitcherVisible = value;
|
|
Q_EMIT isTaskSwitcherVisibleChanged();
|
|
}
|
|
}
|
|
|
|
void ShellDBusObject::openActionDrawer()
|
|
{
|
|
Q_EMIT openActionDrawerRequested();
|
|
}
|
|
|
|
void ShellDBusObject::closeActionDrawer()
|
|
{
|
|
Q_EMIT closeActionDrawerRequested();
|
|
}
|
|
|
|
void ShellDBusObject::openAppLaunchAnimationWithPosition(int screen,
|
|
QString splashIcon,
|
|
QString title,
|
|
QString storageId,
|
|
qreal x,
|
|
qreal y,
|
|
qreal sourceIconSize)
|
|
{
|
|
if (!m_startupFeedbackModel) {
|
|
return;
|
|
}
|
|
|
|
StartupFeedback *feedback = new StartupFeedback{m_startupFeedbackModel, splashIcon, title, storageId, x, y, sourceIconSize, screen};
|
|
m_startupFeedbackModel->addApp(feedback);
|
|
}
|
|
|
|
void ShellDBusObject::triggerAppLaunchMaximizePanelAnimation(int screen, QString color)
|
|
{
|
|
Q_EMIT appLaunchMaximizePanelAnimationTriggered(screen, color);
|
|
}
|
|
|
|
void ShellDBusObject::openHomeScreen()
|
|
{
|
|
Q_EMIT openHomeScreenRequested();
|
|
}
|
|
|
|
void ShellDBusObject::resetHomeScreenPosition()
|
|
{
|
|
Q_EMIT resetHomeScreenPositionRequested();
|
|
}
|
|
|
|
void ShellDBusObject::showVolumeOSD()
|
|
{
|
|
Q_EMIT showVolumeOSDRequested();
|
|
}
|
|
|
|
void ShellDBusObject::openLockScreenKeypad()
|
|
{
|
|
Q_EMIT openLockScreenKeypadRequested();
|
|
}
|