Changeset View
Changeset View
Standalone View
Standalone View
shell_client.h
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | 172 | protected: | |||
---|---|---|---|---|---|
184 | void doMinimize() override; | 184 | void doMinimize() override; | ||
185 | void doMove(int x, int y) override; | 185 | void doMove(int x, int y) override; | ||
186 | void updateCaption() override; | 186 | void updateCaption() override; | ||
187 | 187 | | |||
188 | private Q_SLOTS: | 188 | private Q_SLOTS: | ||
189 | void clientFullScreenChanged(bool fullScreen); | 189 | void clientFullScreenChanged(bool fullScreen); | ||
190 | 190 | | |||
191 | private: | 191 | private: | ||
192 | /* | ||||
193 | * Called when the shell is created. | ||||
194 | */ | ||||
zzag: I'm not sure whether `/* */` is the right choice here. Maybe use single line comments or stick… | |||||
192 | void init(); | 195 | void init(); | ||
196 | /* | ||||
197 | * Called for the XDG case when the shell surface is committed to the surface. | ||||
198 | * At this point all initial properties should have been set by the client. | ||||
199 | */ | ||||
200 | void finishInit(); | ||||
193 | template <class T> | 201 | template <class T> | ||
194 | void initSurface(T *shellSurface); | 202 | void initSurface(T *shellSurface); | ||
195 | void requestGeometry(const QRect &rect); | 203 | void requestGeometry(const QRect &rect); | ||
196 | void doSetGeometry(const QRect &rect); | 204 | void doSetGeometry(const QRect &rect); | ||
197 | void createDecoration(const QRect &oldgeom); | 205 | void createDecoration(const QRect &oldgeom); | ||
198 | void destroyClient(); | 206 | void destroyClient(); | ||
199 | void unmap(); | 207 | void unmap(); | ||
200 | void createWindowId(); | 208 | void createWindowId(); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
256 | bool m_userNoBorder = false; | 264 | bool m_userNoBorder = false; | ||
257 | bool m_fullScreen = false; | 265 | bool m_fullScreen = false; | ||
258 | bool m_transient = false; | 266 | bool m_transient = false; | ||
259 | bool m_hidden = false; | 267 | bool m_hidden = false; | ||
260 | bool m_internal; | 268 | bool m_internal; | ||
261 | bool m_hasPopupGrab = false; | 269 | bool m_hasPopupGrab = false; | ||
262 | qreal m_opacity = 1.0; | 270 | qreal m_opacity = 1.0; | ||
263 | 271 | | |||
264 | class RequestGeometryBlocker { | 272 | class RequestGeometryBlocker { | ||
Also it would be great to tell "future folks" when they could rename it to ConfigureBlocker. :-) zzag: Also it would be great to tell "future folks" when they could rename it to ConfigureBlocker. :-) | |||||
265 | public: | 273 | public: | ||
266 | RequestGeometryBlocker(ShellClient *client) | 274 | RequestGeometryBlocker(ShellClient *client) | ||
267 | : m_client(client) | 275 | : m_client(client) | ||
268 | { | 276 | { | ||
269 | m_client->m_requestGeometryBlockCounter++; | 277 | m_client->m_requestGeometryBlockCounter++; | ||
270 | } | 278 | } | ||
271 | ~RequestGeometryBlocker() | 279 | ~RequestGeometryBlocker() | ||
272 | { | 280 | { | ||
273 | m_client->m_requestGeometryBlockCounter--; | 281 | m_client->m_requestGeometryBlockCounter--; | ||
274 | if (m_client->m_requestGeometryBlockCounter == 0) { | 282 | if (m_client->m_requestGeometryBlockCounter == 0) { | ||
275 | if (m_client->m_blockedRequestGeometry.isValid()) { | 283 | if (m_client->m_blockedRequestGeometry.isValid()) { | ||
276 | m_client->requestGeometry(m_client->m_blockedRequestGeometry); | 284 | m_client->requestGeometry(m_client->m_blockedRequestGeometry); | ||
277 | } else if (m_client->m_xdgShellSurface) { | 285 | } else if (m_client->m_xdgShellSurface) { | ||
278 | m_client->m_xdgShellSurface->configure(m_client->xdgSurfaceStates()); | 286 | m_client->m_xdgShellSurface->configure(m_client->xdgSurfaceStates(), m_client->m_requestedClientSize); | ||
287 | } else if (m_client->m_xdgShellPopup && m_client->transientFor()) { | ||||
288 | const QPoint parentPos = m_client->transientFor()->pos() + m_client->transientFor()->clientPos(); | ||||
289 | m_client->m_xdgShellPopup->configure(QRect(m_client->pos() - parentPos, m_client->size())); | ||||
279 | } | 290 | } | ||
280 | } | 291 | } | ||
281 | } | 292 | } | ||
282 | private: | 293 | private: | ||
283 | ShellClient *m_client; | 294 | ShellClient *m_client; | ||
284 | }; | 295 | }; | ||
285 | friend class RequestGeometryBlocker; | 296 | friend class RequestGeometryBlocker; | ||
286 | int m_requestGeometryBlockCounter = 0; | 297 | int m_requestGeometryBlockCounter = 0; | ||
287 | QRect m_blockedRequestGeometry; | 298 | QRect m_blockedRequestGeometry; | ||
288 | QString m_caption; | 299 | QString m_caption; | ||
289 | QString m_captionSuffix; | 300 | QString m_captionSuffix; | ||
290 | QHash<qint32, PingReason> m_pingSerials; | 301 | QHash<qint32, PingReason> m_pingSerials; | ||
291 | 302 | | |||
292 | bool m_compositingSetup = false; | 303 | bool m_compositingSetup = false; | ||
304 | QScopedPointer<RequestGeometryBlocker> m_initialSetupBlocker; | ||||
293 | }; | 305 | }; | ||
294 | 306 | | |||
295 | } | 307 | } | ||
296 | 308 | | |||
297 | Q_DECLARE_METATYPE(KWin::ShellClient*) | 309 | Q_DECLARE_METATYPE(KWin::ShellClient*) | ||
298 | 310 | | |||
299 | #endif | 311 | #endif |
I'm not sure whether /* */ is the right choice here. Maybe use single line comments or stick with /** **/?