2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
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
|
|
|
|
2011-10-31 20:29:18 +00:00
|
|
|
#include <X11/SM/SMlib.h>
|
|
|
|
#include <fixx11h.h>
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
class QSocketNotifier;
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
class Client;
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
struct SessionInfo {
|
2007-04-29 17:35:43 +00:00
|
|
|
QByteArray sessionId;
|
|
|
|
QByteArray windowRole;
|
|
|
|
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;
|
2012-01-12 06:42:55 +00:00
|
|
|
int tabGroup; // Unique identifier for the client group that this window is in
|
2009-11-15 03:24:04 +00:00
|
|
|
|
2012-01-12 06:42:55 +00:00
|
|
|
Client* tabGroupClient; // The first client created that has an identical identifier
|
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
|
|
|
};
|
|
|
|
|
2014-08-12 07:08:48 +00:00
|
|
|
class KWIN_EXPORT SessionSaveDoneHelper
|
2007-04-29 17:35:43 +00:00
|
|
|
: public QObject
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
Q_OBJECT
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
|
|
|
SessionSaveDoneHelper();
|
|
|
|
virtual ~SessionSaveDoneHelper();
|
|
|
|
SmcConn connection() const {
|
|
|
|
return conn;
|
|
|
|
}
|
|
|
|
void saveDone();
|
|
|
|
void close();
|
2013-07-22 14:07:39 +00:00
|
|
|
private Q_SLOTS:
|
2011-01-30 14:34:42 +00:00
|
|
|
void processData();
|
|
|
|
private:
|
|
|
|
QSocketNotifier* notifier;
|
|
|
|
SmcConn conn;
|
|
|
|
};
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|