Changeset View
Changeset View
Standalone View
Standalone View
shell_client.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org> | 5 | Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org> | ||
6 | Copyright (C) 2018 David Edmundson <davidedmundson@kde.org> | 6 | Copyright (C) 2018 David Edmundson <davidedmundson@kde.org> | ||
7 | Copyright (C) 2019 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
7 | 8 | | |||
8 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | 11 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | 12 | (at your option) any later version. | ||
12 | 13 | | |||
13 | This program is distributed in the hope that it will be useful, | 14 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 55 | public: | |||
120 | * Note that processes started by kwin will share its process id. | 121 | * Note that processes started by kwin will share its process id. | ||
121 | * @since 5.11 | 122 | * @since 5.11 | ||
122 | * @returns the process if for this client. | 123 | * @returns the process if for this client. | ||
123 | */ | 124 | */ | ||
124 | pid_t pid() const override; | 125 | pid_t pid() const override; | ||
125 | 126 | | |||
126 | bool isLockScreen() const override; | 127 | bool isLockScreen() const override; | ||
127 | bool isInputMethod() const override; | 128 | bool isInputMethod() const override; | ||
128 | virtual QWindow *internalWindow() const; | | |||
129 | 129 | | |||
130 | void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface); | 130 | void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface); | ||
131 | void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration); | 131 | void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration); | ||
132 | void installAppMenu(KWayland::Server::AppMenuInterface *appmenu); | 132 | void installAppMenu(KWayland::Server::AppMenuInterface *appmenu); | ||
133 | void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette); | 133 | void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette); | ||
134 | void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration); | 134 | void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration); | ||
135 | 135 | | |||
136 | bool isInitialPositionSet() const override; | 136 | bool isInitialPositionSet() const override; | ||
137 | 137 | | |||
138 | bool isTransient() const override; | 138 | bool isTransient() const override; | ||
139 | bool hasTransientPlacementHint() const override; | 139 | bool hasTransientPlacementHint() const override; | ||
140 | QRect transientPlacement(const QRect &bounds) const override; | 140 | QRect transientPlacement(const QRect &bounds) const override; | ||
141 | 141 | | |||
142 | QMatrix4x4 inputTransformation() const override; | 142 | QMatrix4x4 inputTransformation() const override; | ||
143 | | ||||
144 | bool setupCompositing() override; | | |||
145 | void finishCompositing(ReleaseReason releaseReason = ReleaseReason::Release) override; | | |||
146 | | ||||
147 | void showOnScreenEdge() override; | 143 | void showOnScreenEdge() override; | ||
148 | 144 | | |||
149 | void killWindow() override; | 145 | void killWindow() override; | ||
150 | 146 | | |||
151 | void placeIn(const QRect &area); | 147 | void placeIn(const QRect &area); | ||
152 | 148 | | |||
153 | bool hasPopupGrab() const override; | 149 | bool hasPopupGrab() const override; | ||
154 | void popupDone() override; | 150 | void popupDone() override; | ||
Show All 20 Lines | 170 | void setGeometryRestore(const QRect &geo) override { | |||
175 | m_geomMaximizeRestore = geo; | 171 | m_geomMaximizeRestore = geo; | ||
176 | } | 172 | } | ||
177 | void doResizeSync() override; | 173 | void doResizeSync() override; | ||
178 | bool isWaitingForMoveResizeSync() const override; | 174 | bool isWaitingForMoveResizeSync() const override; | ||
179 | bool acceptsFocus() const override; | 175 | bool acceptsFocus() const override; | ||
180 | void doMinimize() override; | 176 | void doMinimize() override; | ||
181 | void updateCaption() override; | 177 | void updateCaption() override; | ||
182 | 178 | | |||
183 | virtual bool requestGeometry(const QRect &rect); | | |||
184 | virtual void doSetGeometry(const QRect &rect); | | |||
185 | void unmap(); | | |||
186 | void markAsMapped(); | | |||
187 | | ||||
188 | void setClientSize(const QSize &size) { | | |||
189 | m_clientSize = size; | | |||
190 | } | | |||
191 | | ||||
192 | bool isUnmapped() const { | | |||
193 | return m_unmapped; | | |||
194 | } | | |||
195 | | ||||
196 | private Q_SLOTS: | 179 | private Q_SLOTS: | ||
197 | void clientFullScreenChanged(bool fullScreen); | 180 | void clientFullScreenChanged(bool fullScreen); | ||
198 | 181 | | |||
199 | private: | 182 | private: | ||
200 | /** | 183 | /** | ||
201 | * Called when the shell is created. | 184 | * Called when the shell is created. | ||
202 | */ | 185 | */ | ||
203 | void init(); | 186 | void init(); | ||
Show All 13 Lines | |||||
217 | void updateClientOutputs(); | 200 | void updateClientOutputs(); | ||
218 | void updateWindowMargins(); | 201 | void updateWindowMargins(); | ||
219 | KWayland::Server::XdgShellSurfaceInterface::States xdgSurfaceStates() const; | 202 | KWayland::Server::XdgShellSurfaceInterface::States xdgSurfaceStates() const; | ||
220 | void updateShowOnScreenEdge(); | 203 | void updateShowOnScreenEdge(); | ||
221 | void updateMaximizeMode(MaximizeMode maximizeMode); | 204 | void updateMaximizeMode(MaximizeMode maximizeMode); | ||
222 | // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest | 205 | // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest | ||
223 | void updatePendingGeometry(); | 206 | void updatePendingGeometry(); | ||
224 | QPoint popupOffset(const QRect &anchorRect, const Qt::Edges anchorEdge, const Qt::Edges gravity, const QSize popupSize) const; | 207 | QPoint popupOffset(const QRect &anchorRect, const Qt::Edges anchorEdge, const Qt::Edges gravity, const QSize popupSize) const; | ||
208 | void requestGeometry(const QRect &rect); | ||||
209 | void doSetGeometry(const QRect &rect); | ||||
210 | void unmap(); | ||||
211 | void markAsMapped(); | ||||
225 | static void deleteClient(ShellClient *c); | 212 | static void deleteClient(ShellClient *c); | ||
226 | 213 | | |||
227 | QSize toWindowGeometry(const QSize &geometry) const; | 214 | QSize toWindowGeometry(const QSize &geometry) const; | ||
228 | 215 | | |||
229 | KWayland::Server::ShellSurfaceInterface *m_shellSurface; | 216 | KWayland::Server::ShellSurfaceInterface *m_shellSurface; | ||
230 | KWayland::Server::XdgShellSurfaceInterface *m_xdgShellSurface; | 217 | KWayland::Server::XdgShellSurfaceInterface *m_xdgShellSurface; | ||
231 | KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; | 218 | KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; | ||
232 | 219 | | |||
Show All 29 Lines | |||||
262 | QPointer<KWayland::Server::AppMenuInterface> m_appMenuInterface; | 249 | QPointer<KWayland::Server::AppMenuInterface> m_appMenuInterface; | ||
263 | QPointer<KWayland::Server::ServerSideDecorationPaletteInterface> m_paletteInterface; | 250 | QPointer<KWayland::Server::ServerSideDecorationPaletteInterface> m_paletteInterface; | ||
264 | KWayland::Server::ServerSideDecorationInterface *m_serverDecoration = nullptr; | 251 | KWayland::Server::ServerSideDecorationInterface *m_serverDecoration = nullptr; | ||
265 | KWayland::Server::XdgDecorationInterface *m_xdgDecoration = nullptr; | 252 | KWayland::Server::XdgDecorationInterface *m_xdgDecoration = nullptr; | ||
266 | bool m_userNoBorder = false; | 253 | bool m_userNoBorder = false; | ||
267 | bool m_fullScreen = false; | 254 | bool m_fullScreen = false; | ||
268 | bool m_transient = false; | 255 | bool m_transient = false; | ||
269 | bool m_hidden = false; | 256 | bool m_hidden = false; | ||
270 | bool m_internal; | | |||
271 | bool m_hasPopupGrab = false; | 257 | bool m_hasPopupGrab = false; | ||
272 | qreal m_opacity = 1.0; | 258 | qreal m_opacity = 1.0; | ||
273 | 259 | | |||
274 | class RequestGeometryBlocker { //TODO rename ConfigureBlocker when this class is Xdg only | 260 | class RequestGeometryBlocker { //TODO rename ConfigureBlocker when this class is Xdg only | ||
275 | public: | 261 | public: | ||
276 | RequestGeometryBlocker(ShellClient *client) | 262 | RequestGeometryBlocker(ShellClient *client) | ||
277 | : m_client(client) | 263 | : m_client(client) | ||
278 | { | 264 | { | ||
Show All 13 Lines | |||||
292 | int m_requestGeometryBlockCounter = 0; | 278 | int m_requestGeometryBlockCounter = 0; | ||
293 | QRect m_blockedRequestGeometry; | 279 | QRect m_blockedRequestGeometry; | ||
294 | QString m_caption; | 280 | QString m_caption; | ||
295 | QString m_captionSuffix; | 281 | QString m_captionSuffix; | ||
296 | QHash<qint32, PingReason> m_pingSerials; | 282 | QHash<qint32, PingReason> m_pingSerials; | ||
297 | 283 | | |||
298 | QMargins m_windowMargins; | 284 | QMargins m_windowMargins; | ||
299 | 285 | | |||
300 | bool m_compositingSetup = false; | | |||
301 | bool m_isInitialized = false; | 286 | bool m_isInitialized = false; | ||
302 | 287 | | |||
303 | friend class Workspace; | 288 | friend class Workspace; | ||
304 | }; | 289 | }; | ||
305 | 290 | | |||
306 | } | 291 | } | ||
307 | 292 | | |||
308 | Q_DECLARE_METATYPE(KWin::ShellClient*) | 293 | Q_DECLARE_METATYPE(KWin::ShellClient*) | ||
309 | 294 | | |||
310 | #endif | 295 | #endif |