Changeset View
Changeset View
Standalone View
Standalone View
xdgshellclient.h
- This file was moved from shell_client.h.
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | /** | 43 | /** | ||
44 | * @brief The reason for which the server pinged a client surface | 44 | * @brief The reason for which the server pinged a client surface | ||
45 | */ | 45 | */ | ||
46 | enum class PingReason { | 46 | enum class PingReason { | ||
47 | CloseWindow = 0, | 47 | CloseWindow = 0, | ||
48 | FocusWindow | 48 | FocusWindow | ||
49 | }; | 49 | }; | ||
50 | 50 | | |||
51 | class KWIN_EXPORT ShellClient : public AbstractClient | 51 | class KWIN_EXPORT XdgShellClient : public AbstractClient | ||
52 | { | 52 | { | ||
53 | Q_OBJECT | 53 | Q_OBJECT | ||
54 | public: | 54 | public: | ||
55 | ShellClient(KWayland::Server::XdgShellSurfaceInterface *surface); | 55 | XdgShellClient(KWayland::Server::XdgShellSurfaceInterface *surface); | ||
56 | ShellClient(KWayland::Server::XdgShellPopupInterface *surface); | 56 | XdgShellClient(KWayland::Server::XdgShellPopupInterface *surface); | ||
57 | ~ShellClient() override; | 57 | ~XdgShellClient() override; | ||
58 | 58 | | |||
59 | QStringList activities() const override; | 59 | QStringList activities() const override; | ||
60 | QPoint clientContentPos() const override; | 60 | QPoint clientContentPos() const override; | ||
61 | QSize clientSize() const override; | 61 | QSize clientSize() const override; | ||
62 | QRect transparentRect() const override; | 62 | QRect transparentRect() const override; | ||
63 | NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; | 63 | NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; | ||
64 | void debug(QDebug &stream) const override; | 64 | void debug(QDebug &stream) const override; | ||
65 | double opacity() const override; | 65 | double opacity() const override; | ||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | 179 | private: | |||
201 | void updateMaximizeMode(MaximizeMode maximizeMode); | 201 | void updateMaximizeMode(MaximizeMode maximizeMode); | ||
202 | // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest | 202 | // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest | ||
203 | void updatePendingGeometry(); | 203 | void updatePendingGeometry(); | ||
204 | QPoint popupOffset(const QRect &anchorRect, const Qt::Edges anchorEdge, const Qt::Edges gravity, const QSize popupSize) const; | 204 | QPoint popupOffset(const QRect &anchorRect, const Qt::Edges anchorEdge, const Qt::Edges gravity, const QSize popupSize) const; | ||
205 | void requestGeometry(const QRect &rect); | 205 | void requestGeometry(const QRect &rect); | ||
206 | void doSetGeometry(const QRect &rect); | 206 | void doSetGeometry(const QRect &rect); | ||
207 | void unmap(); | 207 | void unmap(); | ||
208 | void markAsMapped(); | 208 | void markAsMapped(); | ||
209 | static void deleteClient(ShellClient *c); | 209 | static void deleteClient(XdgShellClient *c); | ||
210 | 210 | | |||
211 | QSize toWindowGeometry(const QSize &geometry) const; | 211 | QSize toWindowGeometry(const QSize &geometry) const; | ||
212 | 212 | | |||
213 | KWayland::Server::XdgShellSurfaceInterface *m_xdgShellSurface; | 213 | KWayland::Server::XdgShellSurfaceInterface *m_xdgShellSurface; | ||
214 | KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; | 214 | KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; | ||
215 | 215 | | |||
216 | // size of the last buffer | 216 | // size of the last buffer | ||
217 | QSize m_clientSize; | 217 | QSize m_clientSize; | ||
Show All 32 Lines | |||||
250 | bool m_fullScreen = false; | 250 | bool m_fullScreen = false; | ||
251 | bool m_transient = false; | 251 | bool m_transient = false; | ||
252 | bool m_hidden = false; | 252 | bool m_hidden = false; | ||
253 | bool m_hasPopupGrab = false; | 253 | bool m_hasPopupGrab = false; | ||
254 | qreal m_opacity = 1.0; | 254 | qreal m_opacity = 1.0; | ||
255 | 255 | | |||
256 | class RequestGeometryBlocker { //TODO rename ConfigureBlocker when this class is Xdg only | 256 | class RequestGeometryBlocker { //TODO rename ConfigureBlocker when this class is Xdg only | ||
257 | public: | 257 | public: | ||
258 | RequestGeometryBlocker(ShellClient *client) | 258 | RequestGeometryBlocker(XdgShellClient *client) | ||
259 | : m_client(client) | 259 | : m_client(client) | ||
260 | { | 260 | { | ||
261 | m_client->m_requestGeometryBlockCounter++; | 261 | m_client->m_requestGeometryBlockCounter++; | ||
262 | } | 262 | } | ||
263 | ~RequestGeometryBlocker() | 263 | ~RequestGeometryBlocker() | ||
264 | { | 264 | { | ||
265 | m_client->m_requestGeometryBlockCounter--; | 265 | m_client->m_requestGeometryBlockCounter--; | ||
266 | if (m_client->m_requestGeometryBlockCounter == 0) { | 266 | if (m_client->m_requestGeometryBlockCounter == 0) { | ||
267 | m_client->requestGeometry(m_client->m_blockedRequestGeometry); | 267 | m_client->requestGeometry(m_client->m_blockedRequestGeometry); | ||
268 | } | 268 | } | ||
269 | } | 269 | } | ||
270 | private: | 270 | private: | ||
271 | ShellClient *m_client; | 271 | XdgShellClient *m_client; | ||
272 | }; | 272 | }; | ||
273 | friend class RequestGeometryBlocker; | 273 | friend class RequestGeometryBlocker; | ||
274 | int m_requestGeometryBlockCounter = 0; | 274 | int m_requestGeometryBlockCounter = 0; | ||
275 | QRect m_blockedRequestGeometry; | 275 | QRect m_blockedRequestGeometry; | ||
276 | QString m_caption; | 276 | QString m_caption; | ||
277 | QString m_captionSuffix; | 277 | QString m_captionSuffix; | ||
278 | QHash<qint32, PingReason> m_pingSerials; | 278 | QHash<qint32, PingReason> m_pingSerials; | ||
279 | 279 | | |||
280 | QMargins m_windowMargins; | 280 | QMargins m_windowMargins; | ||
281 | 281 | | |||
282 | bool m_isInitialized = false; | 282 | bool m_isInitialized = false; | ||
283 | 283 | | |||
284 | friend class Workspace; | 284 | friend class Workspace; | ||
285 | }; | 285 | }; | ||
286 | 286 | | |||
287 | } | 287 | } | ||
288 | 288 | | |||
289 | Q_DECLARE_METATYPE(KWin::ShellClient*) | 289 | Q_DECLARE_METATYPE(KWin::XdgShellClient *) | ||
290 | 290 | | |||
291 | #endif | 291 | #endif |