mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Replace the convergentwindows KWin script SSD toggling with KWin rules to ensure windows are maximized and have no window border (and toggle off for docked mode). KWin rules work immediately at window creation, which is more efficient than listening to window creation events and manually changing properties on them. Currently, window rules setting maximization don't seem to address all cases where a window gets unmaximized, so for the time being we will still need the logic in convergentwindows to handle any sidecases.
53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
// SPDX-FileCopyrightText: 2024 Luis Büchi <luis.buechi@kdemail.net>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
|
|
#include <KConfigGroup>
|
|
#include <KConfigWatcher>
|
|
#include <KSharedConfig>
|
|
|
|
class Settings : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Settings(QObject *parent = nullptr);
|
|
static Settings &self();
|
|
|
|
// apply the configuration
|
|
void applyConfiguration();
|
|
|
|
private:
|
|
// loads the saved configuration, so it can be restored on desktop
|
|
void loadSavedConfiguration();
|
|
|
|
// applies our mobile configuration
|
|
void applyMobileConfiguration();
|
|
|
|
void writeKeys(const QString &fileName,
|
|
KSharedConfig::Ptr &config,
|
|
const QMap<QString, QMap<QString, QVariant>> &settings,
|
|
bool overwriteOnlyIfEmpty,
|
|
bool saveSettings = true);
|
|
void loadKeys(const QString &fileName, KSharedConfig::Ptr &config, const QMap<QString, QMap<QString, QVariant>> &settings);
|
|
void saveConfigSetting(const QString &fileName, const QString &group, const QString &key, const QVariant value);
|
|
const QString loadSavedConfigSetting(KSharedConfig::Ptr &config, const QString &fileName, const QString &group, const QString &key, bool write = true);
|
|
|
|
void reloadKWinConfig();
|
|
|
|
// whether this is Plasma Mobile
|
|
bool m_isMobilePlatform;
|
|
|
|
KSharedConfig::Ptr m_mobileConfig;
|
|
KSharedConfig::Ptr m_kwinrcConfig;
|
|
KSharedConfig::Ptr m_appBlacklistConfig;
|
|
KSharedConfig::Ptr m_kdeglobalsConfig;
|
|
KSharedConfig::Ptr m_ksmServerConfig;
|
|
KSharedConfig::Ptr m_kwinrulesrcConfig;
|
|
|
|
KConfigWatcher::Ptr m_configWatcher;
|
|
};
|