Changeset View
Changeset View
Standalone View
Standalone View
scripting/workspace_wrapper.cpp
Show All 14 Lines | |||||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | GNU General Public License for more details. | 16 | GNU General Public License for more details. | ||
17 | 17 | | |||
18 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | *********************************************************************/ | 20 | *********************************************************************/ | ||
21 | 21 | | |||
22 | #include "workspace_wrapper.h" | 22 | #include "workspace_wrapper.h" | ||
23 | #include "../client.h" | 23 | #include "../x11client.h" | ||
24 | #include "../outline.h" | 24 | #include "../outline.h" | ||
25 | #include "../screens.h" | 25 | #include "../screens.h" | ||
26 | #include "../xdgshellclient.h" | 26 | #include "../xdgshellclient.h" | ||
27 | #include "../virtualdesktops.h" | 27 | #include "../virtualdesktops.h" | ||
28 | #include "../wayland_server.h" | 28 | #include "../wayland_server.h" | ||
29 | #include "../workspace.h" | 29 | #include "../workspace.h" | ||
30 | #ifdef KWIN_BUILD_ACTIVITIES | 30 | #ifdef KWIN_BUILD_ACTIVITIES | ||
31 | #include "../activities.h" | 31 | #include "../activities.h" | ||
Show All 34 Lines | 64 | [this] (int previousCount, int currentCount) { | |||
66 | emit numberScreensChanged(currentCount); | 66 | emit numberScreensChanged(currentCount); | ||
67 | } | 67 | } | ||
68 | ); | 68 | ); | ||
69 | connect(QApplication::desktop(), SIGNAL(resized(int)), SIGNAL(screenResized(int))); | 69 | connect(QApplication::desktop(), SIGNAL(resized(int)), SIGNAL(screenResized(int))); | ||
70 | if (waylandServer()) { | 70 | if (waylandServer()) { | ||
71 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::clientAdded); | 71 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::clientAdded); | ||
72 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::setupAbstractClientConnections); | 72 | connect(waylandServer(), &WaylandServer::shellClientAdded, this, &WorkspaceWrapper::setupAbstractClientConnections); | ||
73 | } | 73 | } | ||
74 | foreach (KWin::Client *client, ws->clientList()) { | 74 | foreach (KWin::X11Client *client, ws->clientList()) { | ||
75 | setupClientConnections(client); | 75 | setupClientConnections(client); | ||
76 | } | 76 | } | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | int WorkspaceWrapper::currentDesktop() const | 79 | int WorkspaceWrapper::currentDesktop() const | ||
80 | { | 80 | { | ||
81 | return VirtualDesktopManager::self()->current(); | 81 | return VirtualDesktopManager::self()->current(); | ||
82 | } | 82 | } | ||
▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Line(s) | |||||
269 | void WorkspaceWrapper::setupAbstractClientConnections(AbstractClient *client) | 269 | void WorkspaceWrapper::setupAbstractClientConnections(AbstractClient *client) | ||
270 | { | 270 | { | ||
271 | connect(client, &AbstractClient::clientMinimized, this, &WorkspaceWrapper::clientMinimized); | 271 | connect(client, &AbstractClient::clientMinimized, this, &WorkspaceWrapper::clientMinimized); | ||
272 | connect(client, &AbstractClient::clientUnminimized, this, &WorkspaceWrapper::clientUnminimized); | 272 | connect(client, &AbstractClient::clientUnminimized, this, &WorkspaceWrapper::clientUnminimized); | ||
273 | connect(client, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged), | 273 | connect(client, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged), | ||
274 | this, &WorkspaceWrapper::clientMaximizeSet); | 274 | this, &WorkspaceWrapper::clientMaximizeSet); | ||
275 | } | 275 | } | ||
276 | 276 | | |||
277 | void WorkspaceWrapper::setupClientConnections(Client *client) | 277 | void WorkspaceWrapper::setupClientConnections(X11Client *client) | ||
278 | { | 278 | { | ||
279 | setupAbstractClientConnections(client); | 279 | setupAbstractClientConnections(client); | ||
280 | 280 | | |||
281 | connect(client, &Client::clientManaging, this, &WorkspaceWrapper::clientManaging); | 281 | connect(client, &X11Client::clientManaging, this, &WorkspaceWrapper::clientManaging); | ||
282 | connect(client, &Client::clientFullScreenSet, this, &WorkspaceWrapper::clientFullScreenSet); | 282 | connect(client, &X11Client::clientFullScreenSet, this, &WorkspaceWrapper::clientFullScreenSet); | ||
283 | } | 283 | } | ||
284 | 284 | | |||
285 | void WorkspaceWrapper::showOutline(const QRect &geometry) | 285 | void WorkspaceWrapper::showOutline(const QRect &geometry) | ||
286 | { | 286 | { | ||
287 | outline()->show(geometry); | 287 | outline()->show(geometry); | ||
288 | } | 288 | } | ||
289 | 289 | | |||
290 | void WorkspaceWrapper::showOutline(int x, int y, int width, int height) | 290 | void WorkspaceWrapper::showOutline(int x, int y, int width, int height) | ||
291 | { | 291 | { | ||
292 | outline()->show(QRect(x, y, width, height)); | 292 | outline()->show(QRect(x, y, width, height)); | ||
293 | } | 293 | } | ||
294 | 294 | | |||
295 | void WorkspaceWrapper::hideOutline() | 295 | void WorkspaceWrapper::hideOutline() | ||
296 | { | 296 | { | ||
297 | outline()->hide(); | 297 | outline()->hide(); | ||
298 | } | 298 | } | ||
299 | 299 | | |||
300 | Client *WorkspaceWrapper::getClient(qulonglong windowId) | 300 | X11Client *WorkspaceWrapper::getClient(qulonglong windowId) | ||
301 | { | 301 | { | ||
302 | return Workspace::self()->findClient(Predicate::WindowMatch, windowId); | 302 | return Workspace::self()->findClient(Predicate::WindowMatch, windowId); | ||
303 | } | 303 | } | ||
304 | 304 | | |||
305 | QSize WorkspaceWrapper::desktopGridSize() const | 305 | QSize WorkspaceWrapper::desktopGridSize() const | ||
306 | { | 306 | { | ||
307 | return VirtualDesktopManager::self()->grid().size(); | 307 | return VirtualDesktopManager::self()->grid().size(); | ||
308 | } | 308 | } | ||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |