Changeset View
Changeset View
Standalone View
Standalone View
shell_client.h
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
53 | { | 53 | { | ||
54 | Q_OBJECT | 54 | Q_OBJECT | ||
55 | public: | 55 | public: | ||
56 | ShellClient(KWayland::Server::ShellSurfaceInterface *surface); | 56 | ShellClient(KWayland::Server::ShellSurfaceInterface *surface); | ||
57 | ShellClient(KWayland::Server::XdgShellSurfaceInterface *surface); | 57 | ShellClient(KWayland::Server::XdgShellSurfaceInterface *surface); | ||
58 | ShellClient(KWayland::Server::XdgShellPopupInterface *surface); | 58 | ShellClient(KWayland::Server::XdgShellPopupInterface *surface); | ||
59 | virtual ~ShellClient(); | 59 | virtual ~ShellClient(); | ||
60 | 60 | | |||
61 | bool eventFilter(QObject *watched, QEvent *event) override; | | |||
62 | | ||||
63 | QStringList activities() const override; | 61 | QStringList activities() const override; | ||
64 | QPoint clientContentPos() const override; | 62 | QPoint clientContentPos() const override; | ||
65 | QSize clientSize() const override; | 63 | QSize clientSize() const override; | ||
66 | QRect transparentRect() const override; | 64 | QRect transparentRect() const override; | ||
67 | NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; | 65 | NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; | ||
68 | void debug(QDebug &stream) const override; | 66 | void debug(QDebug &stream) const override; | ||
69 | double opacity() const override; | 67 | double opacity() const override; | ||
70 | void setOpacity(double opacity) override; | 68 | void setOpacity(double opacity) override; | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
112 | bool wantsInput() const override; | 110 | bool wantsInput() const override; | ||
113 | bool dockWantsInput() const override; | 111 | bool dockWantsInput() const override; | ||
114 | using AbstractClient::resizeWithChecks; | 112 | using AbstractClient::resizeWithChecks; | ||
115 | void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | 113 | void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | ||
116 | using AbstractClient::setGeometry; | 114 | using AbstractClient::setGeometry; | ||
117 | void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | 115 | void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | ||
118 | bool hasStrut() const override; | 116 | bool hasStrut() const override; | ||
119 | 117 | | |||
120 | void setInternalFramebufferObject(const QSharedPointer<QOpenGLFramebufferObject> &fbo) override; | | |||
121 | | ||||
122 | quint32 windowId() const override { | 118 | quint32 windowId() const override { | ||
123 | return m_windowId; | 119 | return m_windowId; | ||
124 | } | 120 | } | ||
125 | 121 | | |||
126 | /** | 122 | /** | ||
127 | * The process for this client. | 123 | * The process for this client. | ||
128 | * Note that processes started by kwin will share its process id. | 124 | * Note that processes started by kwin will share its process id. | ||
129 | * @since 5.11 | 125 | * @since 5.11 | ||
130 | * @returns the process if for this client. | 126 | * @returns the process if for this client. | ||
131 | **/ | 127 | **/ | ||
132 | pid_t pid() const override; | 128 | pid_t pid() const override; | ||
133 | 129 | | |||
134 | bool isInternal() const; | 130 | virtual bool isInternal() const; | ||
135 | bool isLockScreen() const override; | 131 | bool isLockScreen() const override; | ||
136 | bool isInputMethod() const override; | 132 | bool isInputMethod() const override; | ||
137 | QWindow *internalWindow() const { | 133 | virtual QWindow *internalWindow() const; | ||
138 | return m_internalWindow; | | |||
139 | } | | |||
140 | 134 | | |||
141 | void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface); | 135 | void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface); | ||
142 | void installQtExtendedSurface(KWayland::Server::QtExtendedSurfaceInterface *surface); | 136 | void installQtExtendedSurface(KWayland::Server::QtExtendedSurfaceInterface *surface); | ||
143 | void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration); | 137 | void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration); | ||
144 | void installAppMenu(KWayland::Server::AppMenuInterface *appmenu); | 138 | void installAppMenu(KWayland::Server::AppMenuInterface *appmenu); | ||
145 | void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette); | 139 | void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette); | ||
146 | void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration); | 140 | void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration); | ||
147 | 141 | | |||
Show All 35 Lines | 172 | protected: | |||
183 | void changeMaximize(bool horizontal, bool vertical, bool adjust) override; | 177 | void changeMaximize(bool horizontal, bool vertical, bool adjust) override; | ||
184 | void setGeometryRestore(const QRect &geo) override { | 178 | void setGeometryRestore(const QRect &geo) override { | ||
185 | m_geomMaximizeRestore = geo; | 179 | m_geomMaximizeRestore = geo; | ||
186 | } | 180 | } | ||
187 | void doResizeSync() override; | 181 | void doResizeSync() override; | ||
188 | bool isWaitingForMoveResizeSync() const override; | 182 | bool isWaitingForMoveResizeSync() const override; | ||
189 | bool acceptsFocus() const override; | 183 | bool acceptsFocus() const override; | ||
190 | void doMinimize() override; | 184 | void doMinimize() override; | ||
191 | void doMove(int x, int y) override; | | |||
192 | void updateCaption() override; | 185 | void updateCaption() override; | ||
193 | 186 | | |||
187 | virtual bool requestGeometry(const QRect &rect); | ||||
188 | virtual void doSetGeometry(const QRect &rect); | ||||
189 | void unmap(); | ||||
190 | void markAsMapped(); | ||||
191 | | ||||
192 | void setClientSize(const QSize &size) { | ||||
193 | m_clientSize = size; | ||||
194 | } | ||||
195 | | ||||
196 | bool isUnmapped() const { | ||||
197 | return m_unmapped; | ||||
198 | } | ||||
199 | | ||||
194 | private Q_SLOTS: | 200 | private Q_SLOTS: | ||
195 | void clientFullScreenChanged(bool fullScreen); | 201 | void clientFullScreenChanged(bool fullScreen); | ||
196 | 202 | | |||
197 | private: | 203 | private: | ||
198 | void init(); | 204 | void init(); | ||
199 | template <class T> | 205 | template <class T> | ||
200 | void initSurface(T *shellSurface); | 206 | void initSurface(T *shellSurface); | ||
201 | void requestGeometry(const QRect &rect); | | |||
202 | void doSetGeometry(const QRect &rect); | | |||
203 | void createDecoration(const QRect &oldgeom); | 207 | void createDecoration(const QRect &oldgeom); | ||
204 | void destroyClient(); | 208 | void destroyClient(); | ||
205 | void unmap(); | | |||
206 | void createWindowId(); | 209 | void createWindowId(); | ||
207 | void findInternalWindow(); | | |||
208 | void updateInternalWindowGeometry(); | | |||
209 | void syncGeometryToInternalWindow(); | | |||
210 | void updateIcon(); | 210 | void updateIcon(); | ||
211 | void markAsMapped(); | | |||
212 | void setTransient(); | 211 | void setTransient(); | ||
213 | bool shouldExposeToWindowManagement(); | 212 | bool shouldExposeToWindowManagement(); | ||
214 | void updateClientOutputs(); | 213 | void updateClientOutputs(); | ||
215 | KWayland::Server::XdgShellSurfaceInterface::States xdgSurfaceStates() const; | 214 | KWayland::Server::XdgShellSurfaceInterface::States xdgSurfaceStates() const; | ||
216 | void updateShowOnScreenEdge(); | 215 | void updateShowOnScreenEdge(); | ||
217 | void updateMaximizeMode(MaximizeMode maximizeMode); | 216 | void updateMaximizeMode(MaximizeMode maximizeMode); | ||
218 | // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest | 217 | // called on surface commit and processes all m_pendingConfigureRequests up to m_lastAckedConfigureReqest | ||
219 | void updatePendingGeometry(); | 218 | void updatePendingGeometry(); | ||
Show All 24 Lines | |||||
244 | //mode in use by the current buffer | 243 | //mode in use by the current buffer | ||
245 | MaximizeMode m_maximizeMode = MaximizeRestore; | 244 | MaximizeMode m_maximizeMode = MaximizeRestore; | ||
246 | //mode we currently want to be, could be pending on client updating, could be not sent yet | 245 | //mode we currently want to be, could be pending on client updating, could be not sent yet | ||
247 | MaximizeMode m_requestedMaximizeMode = MaximizeRestore; | 246 | MaximizeMode m_requestedMaximizeMode = MaximizeRestore; | ||
248 | 247 | | |||
249 | QRect m_geomFsRestore; //size and position of the window before it was set to fullscreen | 248 | QRect m_geomFsRestore; //size and position of the window before it was set to fullscreen | ||
250 | bool m_closing = false; | 249 | bool m_closing = false; | ||
251 | quint32 m_windowId = 0; | 250 | quint32 m_windowId = 0; | ||
252 | QWindow *m_internalWindow = nullptr; | | |||
253 | Qt::WindowFlags m_internalWindowFlags = Qt::WindowFlags(); | | |||
254 | bool m_unmapped = true; | 251 | bool m_unmapped = true; | ||
255 | QRect m_geomMaximizeRestore; // size and position of the window before it was set to maximize | 252 | QRect m_geomMaximizeRestore; // size and position of the window before it was set to maximize | ||
256 | NET::WindowType m_windowType = NET::Normal; | 253 | NET::WindowType m_windowType = NET::Normal; | ||
257 | QPointer<KWayland::Server::PlasmaShellSurfaceInterface> m_plasmaShellSurface; | 254 | QPointer<KWayland::Server::PlasmaShellSurfaceInterface> m_plasmaShellSurface; | ||
258 | QPointer<KWayland::Server::QtExtendedSurfaceInterface> m_qtExtendedSurface; | 255 | QPointer<KWayland::Server::QtExtendedSurfaceInterface> m_qtExtendedSurface; | ||
259 | QPointer<KWayland::Server::AppMenuInterface> m_appMenuInterface; | 256 | QPointer<KWayland::Server::AppMenuInterface> m_appMenuInterface; | ||
260 | QPointer<KWayland::Server::ServerSideDecorationPaletteInterface> m_paletteInterface; | 257 | QPointer<KWayland::Server::ServerSideDecorationPaletteInterface> m_paletteInterface; | ||
261 | KWayland::Server::ServerSideDecorationInterface *m_serverDecoration = nullptr; | 258 | KWayland::Server::ServerSideDecorationInterface *m_serverDecoration = nullptr; | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |