mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 02:04:45 +00:00
components: Remove splash screen close button support, due to crashing problems
This commit is contained in:
parent
81c5dfc31f
commit
f913039b63
3 changed files with 1 additions and 62 deletions
|
|
@ -27,7 +27,6 @@
|
||||||
ShellUtil::ShellUtil(QObject *parent)
|
ShellUtil::ShellUtil(QObject *parent)
|
||||||
: QObject{parent}
|
: QObject{parent}
|
||||||
, m_localeConfig{KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig)}
|
, m_localeConfig{KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig)}
|
||||||
, m_launchingApp{nullptr}
|
|
||||||
{
|
{
|
||||||
m_localeConfigWatcher = KConfigWatcher::create(m_localeConfig);
|
m_localeConfigWatcher = KConfigWatcher::create(m_localeConfig);
|
||||||
|
|
||||||
|
|
@ -100,35 +99,4 @@ void ShellUtil::launchApp(const QString &storageId)
|
||||||
auto job = new KIO::ApplicationLauncherJob(service, this);
|
auto job = new KIO::ApplicationLauncherJob(service, this);
|
||||||
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
|
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
|
||||||
job->start();
|
job->start();
|
||||||
|
|
||||||
setLaunchingApp(job);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShellUtil::isLaunchingApp()
|
|
||||||
{
|
|
||||||
return m_launchingApp != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShellUtil::setLaunchingApp(KIO::ApplicationLauncherJob *launcherJob)
|
|
||||||
{
|
|
||||||
m_launchingAppPids = {};
|
|
||||||
m_launchingApp = launcherJob; // do not assume that the pointer is valid, KJobs destroy themselves
|
|
||||||
connect(launcherJob, &KIO::ApplicationLauncherJob::result, this, [this](auto *job) {
|
|
||||||
m_launchingAppPids = m_launchingApp->pids();
|
|
||||||
});
|
|
||||||
Q_EMIT isLaunchingAppChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShellUtil::cancelLaunchingApp()
|
|
||||||
{
|
|
||||||
for (auto pid : m_launchingAppPids) {
|
|
||||||
QProcess::execute("kill", {QString::number(pid)});
|
|
||||||
}
|
|
||||||
clearLaunchingApp();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShellUtil::clearLaunchingApp()
|
|
||||||
{
|
|
||||||
m_launchingApp = nullptr;
|
|
||||||
Q_EMIT isLaunchingAppChanged();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ class ShellUtil : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool isSystem24HourFormat READ isSystem24HourFormat NOTIFY isSystem24HourFormatChanged)
|
Q_PROPERTY(bool isSystem24HourFormat READ isSystem24HourFormat NOTIFY isSystem24HourFormatChanged)
|
||||||
Q_PROPERTY(bool isLaunchingApp READ isLaunchingApp NOTIFY isLaunchingAppChanged)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ShellUtil(QObject *parent = nullptr);
|
ShellUtil(QObject *parent = nullptr);
|
||||||
|
|
@ -64,33 +63,10 @@ public:
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool isSystem24HourFormat();
|
Q_INVOKABLE bool isSystem24HourFormat();
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether an application is being launched.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE bool isLaunchingApp();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancels an application launch by running `kill pid` for every associated pid of the launching app.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE void cancelLaunchingApp();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears the currently stored launching app.
|
|
||||||
*
|
|
||||||
* This should be called if the application window finally shows.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE void clearLaunchingApp();
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void isSystem24HourFormatChanged();
|
void isSystem24HourFormatChanged();
|
||||||
void isLaunchingAppChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setLaunchingApp(KIO::ApplicationLauncherJob *launcherJob);
|
|
||||||
|
|
||||||
KConfigWatcher::Ptr m_localeConfigWatcher;
|
KConfigWatcher::Ptr m_localeConfigWatcher;
|
||||||
KSharedConfig::Ptr m_localeConfig;
|
KSharedConfig::Ptr m_localeConfig;
|
||||||
|
|
||||||
KIO::ApplicationLauncherJob *m_launchingApp;
|
|
||||||
QVector<qint64> m_launchingAppPids;
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ MobileShell.NavigationPanel {
|
||||||
rightAction: MobileShell.NavigationPanelAction {
|
rightAction: MobileShell.NavigationPanelAction {
|
||||||
id: closeAppAction
|
id: closeAppAction
|
||||||
|
|
||||||
enabled: Keyboards.KWinVirtualKeyboard.visible || root.taskSwitcher.visible || MobileShell.WindowUtil.hasCloseableActiveWindow || MobileShell.ShellUtil.isLaunchingApp
|
enabled: Keyboards.KWinVirtualKeyboard.visible || root.taskSwitcher.visible || MobileShell.WindowUtil.hasCloseableActiveWindow
|
||||||
iconSource: Keyboards.KWinVirtualKeyboard.visible ? "go-down-symbolic" : "mobile-close-app"
|
iconSource: Keyboards.KWinVirtualKeyboard.visible ? "go-down-symbolic" : "mobile-close-app"
|
||||||
// mobile-close-app (from plasma-frameworks) seems to have less margins than icons from breeze-icons
|
// mobile-close-app (from plasma-frameworks) seems to have less margins than icons from breeze-icons
|
||||||
iconSizeFactor: Keyboards.KWinVirtualKeyboard.visible ? 1 : 0.75
|
iconSizeFactor: Keyboards.KWinVirtualKeyboard.visible ? 1 : 0.75
|
||||||
|
|
@ -103,11 +103,6 @@ MobileShell.NavigationPanel {
|
||||||
root.taskSwitcher.tasksModel.requestClose(root.taskSwitcher.tasksModel.activeTask);
|
root.taskSwitcher.tasksModel.requestClose(root.taskSwitcher.tasksModel.activeTask);
|
||||||
}
|
}
|
||||||
MobileShellState.Shell.closeAppLaunchAnimation();
|
MobileShellState.Shell.closeAppLaunchAnimation();
|
||||||
} else if (MobileShell.ShellUtil.isLaunchingApp) {
|
|
||||||
|
|
||||||
// cancel the launching of the app
|
|
||||||
MobileShellState.Shell.closeAppLaunchAnimation();
|
|
||||||
MobileShell.ShellUtil.cancelLaunchingApp();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue