shift-shell/components/mobileshellstate/shelldbusobject.h
Devin Lin 3b6951bf1e panel: Overlay over lockscreen
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

![Screencast_20250612_013325](/uploads/49e9981cb863056b4c0c46a144e5ee7d/Screencast_20250612_013325.webm)
2025-07-02 10:27:33 -04:00

88 lines
2.8 KiB
C++

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QObject>
#include <QString>
#include <qqmlregistration.h>
#include "startupfeedbackmodel.h"
class ShellDBusObject : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
Q_CLASSINFO("D-Bus Interface", "org.kde.plasmashell")
Q_PROPERTY(StartupFeedbackModel *startupFeedbackModel READ startupFeedbackModel CONSTANT)
public:
ShellDBusObject(QObject *parent = nullptr);
// called by QML
Q_INVOKABLE void registerObject();
StartupFeedbackModel *startupFeedbackModel();
Q_SIGNALS:
Q_SCRIPTABLE void doNotDisturbChanged();
Q_SCRIPTABLE void isActionDrawerOpenChanged();
Q_SCRIPTABLE void isVolumeOSDOpenChanged();
Q_SCRIPTABLE void isNotificationPopupDrawerOpenChanged();
Q_SCRIPTABLE void panelStateChanged();
Q_SCRIPTABLE void isTaskSwitcherVisibleChanged();
Q_SCRIPTABLE void openActionDrawerRequested();
Q_SCRIPTABLE void closeActionDrawerRequested();
Q_SCRIPTABLE void appLaunchMaximizePanelAnimationTriggered(int screen, QString color);
Q_SCRIPTABLE void openHomeScreenRequested();
Q_SCRIPTABLE void resetHomeScreenPositionRequested();
Q_SCRIPTABLE void showVolumeOSDRequested();
Q_SCRIPTABLE void openLockScreenKeypadRequested();
public Q_SLOTS:
Q_SCRIPTABLE bool doNotDisturb();
Q_SCRIPTABLE void setDoNotDisturb(bool value);
// TODO: Account for multiple action drawers?
Q_SCRIPTABLE bool isActionDrawerOpen();
Q_SCRIPTABLE void setIsActionDrawerOpen(bool value);
Q_SCRIPTABLE bool isVolumeOSDOpen();
Q_SCRIPTABLE void setIsVolumeOSDOpen(bool value);
Q_SCRIPTABLE bool isNotificationPopupDrawerOpen();
Q_SCRIPTABLE void setIsNotificationPopupDrawerOpen(bool value);
Q_SCRIPTABLE QString panelState();
Q_SCRIPTABLE void setPanelState(QString state);
Q_SCRIPTABLE bool isTaskSwitcherVisible();
Q_SCRIPTABLE void setIsTaskSwitcherVisible(bool value);
Q_SCRIPTABLE void openActionDrawer();
Q_SCRIPTABLE void closeActionDrawer();
Q_SCRIPTABLE void
openAppLaunchAnimationWithPosition(int screen, QString splashIcon, QString title, QString storageId, qreal x, qreal y, qreal sourceIconSize);
Q_SCRIPTABLE void triggerAppLaunchMaximizePanelAnimation(int screen, QString color);
Q_SCRIPTABLE void openHomeScreen();
Q_SCRIPTABLE void resetHomeScreenPosition();
Q_SCRIPTABLE void showVolumeOSD();
Q_SCRIPTABLE void openLockScreenKeypad();
private:
bool m_initialized{false};
bool m_doNotDisturb{false};
bool m_isActionDrawerOpen{false};
bool m_isVolumeOSDOpen{false};
bool m_isNotificationPopupDrawerOpen{false};
bool m_isTaskSwitcherVisible{false};
QString m_panelState{};
StartupFeedbackModel *m_startupFeedbackModel{nullptr};
};