2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_SM_H
|
|
|
|
#define KWIN_SM_H
|
|
|
|
|
|
|
|
#include <QDataStream>
|
2013-09-06 13:22:16 +00:00
|
|
|
#include <kwinglobals.h>
|
|
|
|
#include <QStringList>
|
2007-04-29 17:35:43 +00:00
|
|
|
#include <netwm_def.h>
|
2008-02-02 20:54:19 +00:00
|
|
|
#include <QRect>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2019-09-24 08:48:08 +00:00
|
|
|
class X11Client;
|
2009-11-15 03:24:04 +00:00
|
|
|
|
2019-10-31 16:16:53 +00:00
|
|
|
class SessionManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
SessionManager(QObject *parent);
|
|
|
|
~SessionManager() override;
|
|
|
|
|
|
|
|
SessionState state() const;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void stateChanged();
|
|
|
|
|
2020-04-02 11:44:27 +00:00
|
|
|
void loadSessionRequested(const QString &name);
|
|
|
|
void prepareSessionSaveRequested(const QString &name);
|
|
|
|
void finishSessionSaveRequested(const QString &name);
|
|
|
|
|
2019-10-31 16:16:53 +00:00
|
|
|
public Q_SLOTS: // DBus API
|
|
|
|
void setState(uint state);
|
2020-04-02 11:44:27 +00:00
|
|
|
void loadSession(const QString &name);
|
|
|
|
void aboutToSaveSession(const QString &name);
|
|
|
|
void finishSaveSession(const QString &name);
|
2020-11-13 13:08:02 +00:00
|
|
|
void quit();
|
2019-10-31 16:16:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setState(SessionState state);
|
|
|
|
SessionState m_sessionState;
|
|
|
|
};
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
struct SessionInfo {
|
2007-04-29 17:35:43 +00:00
|
|
|
QByteArray sessionId;
|
|
|
|
QByteArray windowRole;
|
2016-06-23 17:40:40 +00:00
|
|
|
QByteArray wmCommand;
|
2007-04-29 17:35:43 +00:00
|
|
|
QByteArray wmClientMachine;
|
|
|
|
QByteArray resourceName;
|
|
|
|
QByteArray resourceClass;
|
|
|
|
|
|
|
|
QRect geometry;
|
|
|
|
QRect restore;
|
|
|
|
QRect fsrestore;
|
|
|
|
int maximized;
|
|
|
|
int fullscreen;
|
|
|
|
int desktop;
|
|
|
|
bool minimized;
|
|
|
|
bool onAllDesktops;
|
|
|
|
bool shaded;
|
|
|
|
bool keepAbove;
|
|
|
|
bool keepBelow;
|
|
|
|
bool skipTaskbar;
|
|
|
|
bool skipPager;
|
2010-05-03 20:04:44 +00:00
|
|
|
bool skipSwitcher;
|
2008-03-23 00:12:11 +00:00
|
|
|
bool noBorder;
|
2007-04-29 17:35:43 +00:00
|
|
|
NET::WindowType windowType;
|
|
|
|
QString shortcut;
|
|
|
|
bool active; // means 'was active in the saved session'
|
|
|
|
int stackingOrder;
|
2009-08-15 17:33:47 +00:00
|
|
|
float opacity;
|
2009-11-15 03:24:04 +00:00
|
|
|
|
2010-10-02 17:04:24 +00:00
|
|
|
QStringList activities;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
enum SMSavePhase {
|
2007-04-29 17:35:43 +00:00
|
|
|
SMSavePhase0, // saving global state in "phase 0"
|
|
|
|
SMSavePhase2, // saving window state in phase 2
|
|
|
|
SMSavePhase2Full // complete saving in phase2, there was no phase 0
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|