Changeset View
Changeset View
Standalone View
Standalone View
workspace.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | #include "platform.h" | 51 | #include "platform.h" | ||
52 | #include "scripting/scripting.h" | 52 | #include "scripting/scripting.h" | ||
53 | #ifdef KWIN_BUILD_TABBOX | 53 | #ifdef KWIN_BUILD_TABBOX | ||
54 | #include "tabbox.h" | 54 | #include "tabbox.h" | ||
55 | #endif | 55 | #endif | ||
56 | #include "unmanaged.h" | 56 | #include "unmanaged.h" | ||
57 | #include "useractions.h" | 57 | #include "useractions.h" | ||
58 | #include "virtualdesktops.h" | 58 | #include "virtualdesktops.h" | ||
59 | #include "shell_client.h" | 59 | #include "xdgshellclient.h" | ||
60 | #include "was_user_interaction_x11_filter.h" | 60 | #include "was_user_interaction_x11_filter.h" | ||
61 | #include "wayland_server.h" | 61 | #include "wayland_server.h" | ||
62 | #include "xcbutils.h" | 62 | #include "xcbutils.h" | ||
63 | #include "main.h" | 63 | #include "main.h" | ||
64 | #include "decorations/decorationbridge.h" | 64 | #include "decorations/decorationbridge.h" | ||
65 | // KDE | 65 | // KDE | ||
66 | #include <KConfig> | 66 | #include <KConfig> | ||
67 | #include <KConfigGroup> | 67 | #include <KConfigGroup> | ||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 201 | { | |||
286 | active_client = NULL; | 286 | active_client = NULL; | ||
287 | 287 | | |||
288 | initWithX11(); | 288 | initWithX11(); | ||
289 | 289 | | |||
290 | Scripting::create(this); | 290 | Scripting::create(this); | ||
291 | 291 | | |||
292 | if (auto w = waylandServer()) { | 292 | if (auto w = waylandServer()) { | ||
293 | connect(w, &WaylandServer::shellClientAdded, this, | 293 | connect(w, &WaylandServer::shellClientAdded, this, | ||
294 | [this] (ShellClient *c) { | 294 | [this] (XdgShellClient *c) { | ||
295 | setupClientConnections(c); | 295 | setupClientConnections(c); | ||
296 | c->updateDecoration(false); | 296 | c->updateDecoration(false); | ||
297 | updateClientLayer(c); | 297 | updateClientLayer(c); | ||
298 | if (!c->isInternal()) { | 298 | if (!c->isInternal()) { | ||
299 | QRect area = clientArea(PlacementArea, Screens::self()->current(), c->desktop()); | 299 | QRect area = clientArea(PlacementArea, Screens::self()->current(), c->desktop()); | ||
300 | bool placementDone = false; | 300 | bool placementDone = false; | ||
301 | if (c->isInitialPositionSet()) { | 301 | if (c->isInitialPositionSet()) { | ||
302 | placementDone = true; | 302 | placementDone = true; | ||
Show All 18 Lines | |||||
321 | } | 321 | } | ||
322 | markXStackingOrderAsDirty(); | 322 | markXStackingOrderAsDirty(); | ||
323 | updateStackingOrder(true); | 323 | updateStackingOrder(true); | ||
324 | updateClientArea(); | 324 | updateClientArea(); | ||
325 | if (c->wantsInput() && !c->isMinimized()) { | 325 | if (c->wantsInput() && !c->isMinimized()) { | ||
326 | activateClient(c); | 326 | activateClient(c); | ||
327 | } | 327 | } | ||
328 | updateTabbox(); | 328 | updateTabbox(); | ||
329 | connect(c, &ShellClient::windowShown, this, | 329 | connect(c, &XdgShellClient::windowShown, this, | ||
330 | [this, c] { | 330 | [this, c] { | ||
331 | updateClientLayer(c); | 331 | updateClientLayer(c); | ||
332 | // TODO: when else should we send the client through placement? | 332 | // TODO: when else should we send the client through placement? | ||
333 | if (c->hasTransientPlacementHint()) { | 333 | if (c->hasTransientPlacementHint()) { | ||
334 | QRect area = clientArea(PlacementArea, Screens::self()->current(), c->desktop()); | 334 | QRect area = clientArea(PlacementArea, Screens::self()->current(), c->desktop()); | ||
335 | c->placeIn(area); | 335 | c->placeIn(area); | ||
336 | } | 336 | } | ||
337 | markXStackingOrderAsDirty(); | 337 | markXStackingOrderAsDirty(); | ||
338 | updateStackingOrder(true); | 338 | updateStackingOrder(true); | ||
339 | updateClientArea(); | 339 | updateClientArea(); | ||
340 | if (c->wantsInput()) { | 340 | if (c->wantsInput()) { | ||
341 | activateClient(c); | 341 | activateClient(c); | ||
342 | } | 342 | } | ||
343 | } | 343 | } | ||
344 | ); | 344 | ); | ||
345 | connect(c, &ShellClient::windowHidden, this, | 345 | connect(c, &XdgShellClient::windowHidden, this, | ||
346 | [this] { | 346 | [this] { | ||
347 | // TODO: update tabbox if it's displayed | 347 | // TODO: update tabbox if it's displayed | ||
348 | markXStackingOrderAsDirty(); | 348 | markXStackingOrderAsDirty(); | ||
349 | updateStackingOrder(true); | 349 | updateStackingOrder(true); | ||
350 | updateClientArea(); | 350 | updateClientArea(); | ||
351 | } | 351 | } | ||
352 | ); | 352 | ); | ||
353 | } | 353 | } | ||
354 | ); | 354 | ); | ||
355 | connect(w, &WaylandServer::shellClientRemoved, this, | 355 | connect(w, &WaylandServer::shellClientRemoved, this, | ||
356 | [this] (ShellClient *c) { | 356 | [this] (XdgShellClient *c) { | ||
357 | m_allClients.removeAll(c); | 357 | m_allClients.removeAll(c); | ||
358 | if (c == most_recently_raised) { | 358 | if (c == most_recently_raised) { | ||
359 | most_recently_raised = nullptr; | 359 | most_recently_raised = nullptr; | ||
360 | } | 360 | } | ||
361 | if (c == delayfocus_client) { | 361 | if (c == delayfocus_client) { | ||
362 | cancelDelayFocus(); | 362 | cancelDelayFocus(); | ||
363 | } | 363 | } | ||
364 | if (c == last_active_client) { | 364 | if (c == last_active_client) { | ||
▲ Show 20 Lines • Show All 1453 Lines • Show Last 20 Lines |