Changeset View
Changeset View
Standalone View
Standalone View
ksmserver/server.h
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 80 | public: | |||
---|---|---|---|---|---|
81 | enum class InitFlag { | 81 | enum class InitFlag { | ||
82 | None = 0, | 82 | None = 0, | ||
83 | OnlyLocal = 1 << 0, | 83 | OnlyLocal = 1 << 0, | ||
84 | ImmediateLockScreen = 1 << 1, | 84 | ImmediateLockScreen = 1 << 1, | ||
85 | NoLockScreen = 1 << 2 | 85 | NoLockScreen = 1 << 2 | ||
86 | }; | 86 | }; | ||
87 | 87 | | |||
88 | Q_DECLARE_FLAGS(InitFlags, InitFlag) | 88 | Q_DECLARE_FLAGS(InitFlags, InitFlag) | ||
89 | KSMServer( const QString& windowManager, InitFlags flags ); | 89 | KSMServer(InitFlags flags ); | ||
90 | ~KSMServer() override; | 90 | ~KSMServer() override; | ||
91 | 91 | | |||
92 | static KSMServer* self(); | 92 | static KSMServer* self(); | ||
93 | 93 | | |||
94 | void* watchConnection( IceConn iceConn ); | 94 | void* watchConnection( IceConn iceConn ); | ||
95 | void removeConnection( KSMConnection* conn ); | 95 | void removeConnection( KSMConnection* conn ); | ||
96 | 96 | | |||
97 | KSMClient* newClient( SmsConn ); | 97 | KSMClient* newClient( SmsConn ); | ||
98 | void deleteClient( KSMClient* client ); | 98 | void deleteClient( KSMClient* client ); | ||
99 | 99 | | |||
100 | // callbacks | 100 | // callbacks | ||
101 | void saveYourselfDone( KSMClient* client, bool success ); | 101 | void saveYourselfDone( KSMClient* client, bool success ); | ||
102 | void interactRequest( KSMClient* client, int dialogType ); | 102 | void interactRequest( KSMClient* client, int dialogType ); | ||
103 | void interactDone( KSMClient* client, bool cancelShutdown ); | 103 | void interactDone( KSMClient* client, bool cancelShutdown ); | ||
104 | void phase2Request( KSMClient* client ); | 104 | void phase2Request( KSMClient* client ); | ||
105 | 105 | | |||
106 | // error handling | 106 | // error handling | ||
107 | void ioError( IceConn iceConn ); | 107 | void ioError( IceConn iceConn ); | ||
108 | 108 | | |||
109 | // notification | 109 | // notification | ||
110 | void clientSetProgram( KSMClient* client ); | | |||
111 | void clientRegistered( const char* previousId ); | 110 | void clientRegistered( const char* previousId ); | ||
112 | 111 | | |||
113 | // public API | 112 | // public API | ||
114 | void performLogout(); | 113 | void performLogout(); | ||
115 | void restoreSession(); | 114 | void restoreSession(); | ||
116 | void restoreSession( const QString &sessionName ); | 115 | void restoreSession( const QString &sessionName ); | ||
117 | void startDefaultSession(); | 116 | void startDefaultSession(); | ||
118 | void shutdown( KWorkSpace::ShutdownConfirm confirm, | 117 | void shutdown( KWorkSpace::ShutdownConfirm confirm, | ||
119 | KWorkSpace::ShutdownType sdtype, | 118 | KWorkSpace::ShutdownType sdtype, | ||
120 | KWorkSpace::ShutdownMode sdmode ); | 119 | KWorkSpace::ShutdownMode sdmode ); | ||
121 | 120 | | |||
122 | void setupShortcuts(); | 121 | void setupShortcuts(); | ||
123 | 122 | | |||
124 | Q_SIGNALS: | 123 | Q_SIGNALS: | ||
125 | void windowManagerLoaded(); | | |||
126 | void logoutCancelled(); | 124 | void logoutCancelled(); | ||
127 | 125 | | |||
128 | public Q_SLOTS: | 126 | public Q_SLOTS: | ||
129 | 127 | | |||
130 | void cleanUp(); | 128 | void cleanUp(); | ||
131 | 129 | | |||
132 | private Q_SLOTS: | 130 | private Q_SLOTS: | ||
133 | void newConnection( int socket ); | 131 | void newConnection( int socket ); | ||
134 | void processData( int socket ); | 132 | void processData( int socket ); | ||
135 | 133 | | |||
136 | void protectionTimeout(); | 134 | void protectionTimeout(); | ||
137 | void timeoutQuit(); | 135 | void timeoutQuit(); | ||
138 | void timeoutWMQuit(); | | |||
139 | | ||||
140 | void wmProcessChange(); | | |||
141 | 136 | | |||
142 | void defaultLogout(); | 137 | void defaultLogout(); | ||
143 | void logoutWithoutConfirmation(); | 138 | void logoutWithoutConfirmation(); | ||
144 | void haltWithoutConfirmation(); | 139 | void haltWithoutConfirmation(); | ||
145 | void rebootWithoutConfirmation(); | 140 | void rebootWithoutConfirmation(); | ||
146 | 141 | | |||
147 | private: | 142 | private: | ||
148 | void handlePendingInteractions(); | 143 | void handlePendingInteractions(); | ||
149 | void completeShutdownOrCheckpoint(); | 144 | void completeShutdownOrCheckpoint(); | ||
150 | void startKilling(); | 145 | void startKilling(); | ||
151 | void startKillingSubSession(); | 146 | void startKillingSubSession(); | ||
152 | void performStandardKilling(); | 147 | void performStandardKilling(); | ||
153 | void completeKilling(); | 148 | void completeKilling(); | ||
154 | void completeKillingSubSession(); | 149 | void completeKillingSubSession(); | ||
155 | void killWM(); | | |||
156 | void signalSubSessionClosed(); | 150 | void signalSubSessionClosed(); | ||
157 | void completeKillingWM(); | | |||
158 | void cancelShutdown( KSMClient* c ); | 151 | void cancelShutdown( KSMClient* c ); | ||
159 | void killingCompleted(); | 152 | void killingCompleted(); | ||
160 | 153 | | |||
161 | void discardSession(); | 154 | void discardSession(); | ||
162 | void storeSession(); | 155 | void storeSession(); | ||
163 | 156 | | |||
164 | void startProtection(); | 157 | void startProtection(); | ||
165 | void endProtection(); | 158 | void endProtection(); | ||
166 | 159 | | |||
167 | void launchWM( const QList< QStringList >& wmStartCommands ); | | |||
168 | | ||||
169 | KProcess* startApplication( const QStringList& command, | 160 | KProcess* startApplication( const QStringList& command, | ||
170 | const QString& clientMachine = QString(), | 161 | const QString& clientMachine = QString(), | ||
171 | const QString& userId = QString(), | 162 | const QString& userId = QString(), | ||
172 | bool wm = false ); | 163 | bool wm = false ); | ||
173 | void executeCommand( const QStringList& command ); | 164 | void executeCommand( const QStringList& command ); | ||
174 | 165 | | |||
175 | bool isWM( const KSMClient* client ) const; | | |||
176 | bool isWM( const QString& program ) const; | | |||
177 | bool defaultSession() const; // empty session | 166 | bool defaultSession() const; // empty session | ||
178 | void setupXIOErrorHandler(); | 167 | void setupXIOErrorHandler(); | ||
179 | 168 | | |||
180 | void performLegacySessionSave(); | 169 | void performLegacySessionSave(); | ||
181 | void storeLegacySession( KConfig* config ); | 170 | void storeLegacySession( KConfig* config ); | ||
182 | void restoreLegacySession( KConfig* config ); | 171 | void restoreLegacySession( KConfig* config ); | ||
183 | void restoreLegacySessionInternal( KConfigGroup* config, char sep = ',' ); | 172 | void restoreLegacySessionInternal( KConfigGroup* config, char sep = ',' ); | ||
184 | QStringList windowWmCommand(WId w); | 173 | QStringList windowWmCommand(WId w); | ||
Show All 32 Lines | |||||
217 | 206 | | |||
218 | private: | 207 | private: | ||
219 | QList<KSMListener*> listener; | 208 | QList<KSMListener*> listener; | ||
220 | QList<KSMClient*> clients; | 209 | QList<KSMClient*> clients; | ||
221 | 210 | | |||
222 | enum State | 211 | enum State | ||
223 | { | 212 | { | ||
224 | Idle, | 213 | Idle, | ||
225 | LaunchingWM, Restoring, | 214 | RestoringWMSession, Restoring, | ||
226 | Shutdown, Checkpoint, Killing, KillingWM, WaitingForKNotify, // shutdown | 215 | Shutdown, Checkpoint, Killing, WaitingForKNotify, // shutdown | ||
davidedmundson: Can you not just kill them?
It's not public API | |||||
227 | ClosingSubSession, KillingSubSession, RestoringSubSession | 216 | ClosingSubSession, KillingSubSession, RestoringSubSession | ||
228 | }; | 217 | }; | ||
229 | State state; | 218 | State state; | ||
230 | bool saveSession; | 219 | bool saveSession; | ||
231 | int wmPhase1WaitingCount; | | |||
232 | int saveType; | 220 | int saveType; | ||
233 | 221 | | |||
234 | bool clean; | 222 | bool clean; | ||
235 | KSMClient* clientInteracting; | 223 | KSMClient* clientInteracting; | ||
236 | QString wm; | | |||
237 | QStringList wmCommands; | | |||
238 | KProcess* wmProcess; | | |||
239 | QString sessionGroup; | 224 | QString sessionGroup; | ||
240 | QString sessionName; | | |||
241 | QTimer protectionTimer; | 225 | QTimer protectionTimer; | ||
242 | QTimer restoreTimer; | 226 | QTimer restoreTimer; | ||
243 | QString xonCommand; | 227 | QString xonCommand; | ||
244 | // sequential startup | 228 | // sequential startup | ||
245 | int appsToStart; | 229 | int appsToStart; | ||
246 | int lastAppStarted; | 230 | int lastAppStarted; | ||
247 | QString lastIdStarted; | 231 | QString lastIdStarted; | ||
248 | 232 | | |||
Show All 18 Lines |
Can you not just kill them?
It's not public API