7#ifndef QT_NO_SESSIONMANAGER
9#include <QtCore/qvarlengtharray.h>
10#include <qpa/qwindowsysteminterface.h>
15#include <qplatformdefs.h>
17#include <X11/SM/SMlib.h>
55 int num_vals, SmPropValue *vals);
57 int saveType, Bool shutdown ,
int interactStyle, Bool fast);
81 int num_vals, SmPropValue *vals)
85 prop.name =
const_cast<char*
>(
name);
86 prop.type =
const_cast<char*
>(
type);
87 prop.num_vals = num_vals;
105 prop.value = (SmPointer)
const_cast<char *
>(
v.constData());
111 SmPropValue *prop =
new SmPropValue[
value.size()];
116 prop[
count].length = (*it).size();
117 vl.
append((*it).toUtf8());
133 int saveType, Bool shutdown ,
int interactStyle, Bool )
145 ((
QT_smcConn*)smcConn)->save_yourself_in_progress =
true;
147 ((
QT_smcConn*)smcConn)->shutdown_in_progress =
true;
161 gettimeofday(&tv,
nullptr);
173 struct passwd *entryPtr =
nullptr;
174#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
177 while (getpwuid_r(geteuid(), &
entry,
buf.data(),
buf.size(), &entryPtr) == ERANGE) {
178 if (
buf.size() >= 32768) {
180 static char badusername[] =
"";
182 entry.pw_name = badusername;
187 buf.resize(
buf.size() * 2);
190 entryPtr = getpwuid(geteuid());
201 restart <<
"-name"_L1 <<
qAppName();
245 prop.length =
sizeof(int);
247 prop.value = (SmPointer) &
value;
260 QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>();
298 IceProcessMessages(SmcGetIceConnection(
smcConnection),
nullptr,
nullptr);
310 char* myId =
nullptr;
312 char* prevId = b_id.
data();
316 cb.save_yourself.client_data = (SmPointer)
this;
318 cb.die.client_data = (SmPointer)
this;
320 cb.save_complete.client_data = (SmPointer)
this;
322 cb.shutdown_cancelled.client_data = (SmPointer)
this;
329 SmcSaveYourselfProcMask |
331 SmcSaveCompleteProcMask |
332 SmcShutdownCancelledProcMask,
378 m_eventLoop = &eventLoop;
380 m_eventLoop =
nullptr;
408 m_eventLoop = &eventLoop;
410 m_eventLoop =
nullptr;
462#include "qxcbsessionmanager.moc"
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype length() const noexcept
Same as size().
static QString applicationFilePath()
Returns the file path of the application executable.
static QStringList arguments()
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
void exit(int returnCode=0)
Tells the event loop to exit with a return code.
\inmodule QtCore \reentrant
QString fileName() const
Returns the name of the file, excluding the path.
bool isEmpty() const noexcept
const T & constLast() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator ConstIterator
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QSmSocketReceiver(int socket)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setSessionKey(const QString &key)
QXcbSessionManager(const QString &id, const QString &key)
void requestPhase2() override
bool isPhase2() const override
void setManagerProperty(const QString &name, const QString &value) override
bool allowsInteraction() override
virtual ~QXcbSessionManager()
bool allowsErrorInteraction() override
void setSessionId(const QString &id)
QSet< QString >::iterator it
QList< QVariant > arguments
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLsizei const GLenum * props
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define qPrintable(string)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
static int compare(quint64 a, quint64 b)
static int sm_interactStyle
static bool sm_interactionActive
static void sm_setProperty(const char *name, const char *type, int num_vals, SmPropValue *vals)
static void sm_saveYourselfPhase2Callback(SmcConn smcConn, SmPointer clientData)
static bool sm_waitingForInteraction
static void sm_saveYourselfCallback(SmcConn smcConn, SmPointer clientData, int saveType, Bool shutdown, int interactStyle, Bool fast)
static void sm_dieCallback(SmcConn smcConn, SmPointer clientData)
static void sm_saveCompleteCallback(SmcConn smcConn, SmPointer clientData)
bool qt_sm_blockUserInput
static void resetSmState()
static void sm_shutdownCancelledCallback(SmcConn smcConn, SmPointer clientData)
static QSmSocketReceiver * sm_receiver
static void sm_performSaveYourself(QXcbSessionManager *)
static SmcConn smcConnection
static void sm_interactCallback(SmcConn smcConn, SmPointer clientData)
static bool sm_isshutdown
QFileInfo fi("c:/temp/foo")
[newstuff]
unsigned int shutdown_in_progress
unsigned int save_yourself_in_progress