2007-11-27 22:40:25 +03:00
|
|
|
/********************************************************************
|
2007-04-29 21:35:43 +04: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 22:40:25 +03: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 21:35:43 +04:00
|
|
|
|
|
|
|
#ifndef KWIN_SM_H
|
|
|
|
#define KWIN_SM_H
|
|
|
|
|
|
|
|
#include <QDataStream>
|
2013-09-06 17:22:16 +04:00
|
|
|
#include <kwinglobals.h>
|
|
|
|
#include <QStringList>
|
2007-04-29 21:35:43 +04:00
|
|
|
#include <netwm_def.h>
|
2008-02-02 23:54:19 +03:00
|
|
|
#include <QRect>
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-11-01 00:29:18 +04:00
|
|
|
#include <X11/SM/SMlib.h>
|
|
|
|
#include <fixx11h.h>
|
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
class QSocketNotifier;
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2009-11-15 06:24:04 +03:00
|
|
|
class Client;
|
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
struct SessionInfo {
|
2007-04-29 21:35:43 +04:00
|
|
|
QByteArray sessionId;
|
|
|
|
QByteArray windowRole;
|
|
|
|
QByteArray wmCommand;
|
|
|
|
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-04 00:04:44 +04:00
|
|
|
bool skipSwitcher;
|
2008-03-23 03:12:11 +03:00
|
|
|
bool noBorder;
|
2007-04-29 21:35:43 +04:00
|
|
|
NET::WindowType windowType;
|
|
|
|
QString shortcut;
|
|
|
|
bool active; // means 'was active in the saved session'
|
|
|
|
int stackingOrder;
|
2009-08-15 21:33:47 +04:00
|
|
|
float opacity;
|
2012-01-12 10:42:55 +04:00
|
|
|
int tabGroup; // Unique identifier for the client group that this window is in
|
2009-11-15 06:24:04 +03:00
|
|
|
|
2012-01-12 10:42:55 +04:00
|
|
|
Client* tabGroupClient; // The first client created that has an identical identifier
|
2010-10-02 21:04:24 +04:00
|
|
|
QStringList activities;
|
2011-01-30 17:34:42 +03:00
|
|
|
};
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
enum SMSavePhase {
|
2007-04-29 21:35:43 +04: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 17:34:42 +03:00
|
|
|
};
|
|
|
|
|
2014-08-12 11:08:48 +04:00
|
|
|
class KWIN_EXPORT SessionSaveDoneHelper
|
2007-04-29 21:35:43 +04:00
|
|
|
: public QObject
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
Q_OBJECT
|
2011-01-30 17:34:42 +03:00
|
|
|
public:
|
|
|
|
SessionSaveDoneHelper();
|
|
|
|
virtual ~SessionSaveDoneHelper();
|
|
|
|
SmcConn connection() const {
|
|
|
|
return conn;
|
|
|
|
}
|
|
|
|
void saveDone();
|
|
|
|
void close();
|
2013-07-22 18:07:39 +04:00
|
|
|
private Q_SLOTS:
|
2011-01-30 17:34:42 +03:00
|
|
|
void processData();
|
|
|
|
private:
|
|
|
|
QSocketNotifier* notifier;
|
|
|
|
SmcConn conn;
|
|
|
|
};
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|