Changeset View
Changeset View
Standalone View
Standalone View
composite.cpp
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "composite.h" | 20 | #include "composite.h" | ||
21 | 21 | | |||
22 | #include "dbusinterface.h" | 22 | #include "dbusinterface.h" | ||
23 | #include "client.h" | 23 | #include "client.h" | ||
24 | #include "decorations/decoratedclient.h" | 24 | #include "decorations/decoratedclient.h" | ||
25 | #include "deleted.h" | 25 | #include "deleted.h" | ||
26 | #include "effects.h" | 26 | #include "effects.h" | ||
27 | #include "internal_client.h" | ||||
27 | #include "overlaywindow.h" | 28 | #include "overlaywindow.h" | ||
28 | #include "platform.h" | 29 | #include "platform.h" | ||
29 | #include "scene.h" | 30 | #include "scene.h" | ||
30 | #include "screens.h" | 31 | #include "screens.h" | ||
31 | #include "shadow.h" | 32 | #include "shadow.h" | ||
32 | #include "shell_client.h" | 33 | #include "shell_client.h" | ||
33 | #include "unmanaged.h" | 34 | #include "unmanaged.h" | ||
34 | #include "useractions.h" | 35 | #include "useractions.h" | ||
▲ Show 20 Lines • Show All 317 Lines • ▼ Show 20 Line(s) | 326 | { | |||
352 | } | 353 | } | ||
353 | for (Client *c : Workspace::self()->desktopList()) { | 354 | for (Client *c : Workspace::self()->desktopList()) { | ||
354 | c->setupCompositing(); | 355 | c->setupCompositing(); | ||
355 | } | 356 | } | ||
356 | for (Unmanaged *c : Workspace::self()->unmanagedList()) { | 357 | for (Unmanaged *c : Workspace::self()->unmanagedList()) { | ||
357 | c->setupCompositing(); | 358 | c->setupCompositing(); | ||
358 | c->getShadow(); | 359 | c->getShadow(); | ||
359 | } | 360 | } | ||
361 | for (InternalClient *client : workspace()->internalClients()) { | ||||
362 | client->setupCompositing(); | ||||
363 | client->getShadow(); | ||||
364 | } | ||||
360 | 365 | | |||
361 | if (auto *server = waylandServer()) { | 366 | if (auto *server = waylandServer()) { | ||
362 | const auto clients = server->clients(); | 367 | const auto clients = server->clients(); | ||
363 | for (ShellClient *c : clients) { | 368 | for (ShellClient *c : clients) { | ||
364 | c->setupCompositing(); | 369 | c->setupCompositing(); | ||
365 | c->getShadow(); | 370 | c->getShadow(); | ||
366 | } | 371 | } | ||
367 | const auto internalClients = server->internalClients(); | | |||
368 | for (ShellClient *c : internalClients) { | | |||
369 | c->setupCompositing(); | | |||
370 | c->getShadow(); | | |||
371 | } | | |||
372 | } | 372 | } | ||
373 | 373 | | |||
374 | m_state = State::On; | 374 | m_state = State::On; | ||
375 | emit compositingToggled(true); | 375 | emit compositingToggled(true); | ||
376 | 376 | | |||
377 | if (m_releaseSelectionTimer.isActive()) { | 377 | if (m_releaseSelectionTimer.isActive()) { | ||
378 | m_releaseSelectionTimer.stop(); | 378 | m_releaseSelectionTimer.stop(); | ||
379 | } | 379 | } | ||
Show All 30 Lines | 409 | for (Client *c : Workspace::self()->clientList()) { | |||
410 | m_scene->removeToplevel(c); | 410 | m_scene->removeToplevel(c); | ||
411 | } | 411 | } | ||
412 | for (Client *c : Workspace::self()->desktopList()) { | 412 | for (Client *c : Workspace::self()->desktopList()) { | ||
413 | m_scene->removeToplevel(c); | 413 | m_scene->removeToplevel(c); | ||
414 | } | 414 | } | ||
415 | for (Unmanaged *c : Workspace::self()->unmanagedList()) { | 415 | for (Unmanaged *c : Workspace::self()->unmanagedList()) { | ||
416 | m_scene->removeToplevel(c); | 416 | m_scene->removeToplevel(c); | ||
417 | } | 417 | } | ||
418 | for (InternalClient *client : workspace()->internalClients()) { | ||||
419 | m_scene->removeToplevel(client); | ||||
420 | } | ||||
418 | for (Client *c : Workspace::self()->clientList()) { | 421 | for (Client *c : Workspace::self()->clientList()) { | ||
419 | c->finishCompositing(); | 422 | c->finishCompositing(); | ||
420 | } | 423 | } | ||
421 | for (Client *c : Workspace::self()->desktopList()) { | 424 | for (Client *c : Workspace::self()->desktopList()) { | ||
422 | c->finishCompositing(); | 425 | c->finishCompositing(); | ||
423 | } | 426 | } | ||
424 | for (Unmanaged *c : Workspace::self()->unmanagedList()) { | 427 | for (Unmanaged *c : Workspace::self()->unmanagedList()) { | ||
425 | c->finishCompositing(); | 428 | c->finishCompositing(); | ||
426 | } | 429 | } | ||
430 | for (InternalClient *client : workspace()->internalClients()) { | ||||
431 | client->finishCompositing(); | ||||
432 | } | ||||
427 | if (auto *con = kwinApp()->x11Connection()) { | 433 | if (auto *con = kwinApp()->x11Connection()) { | ||
428 | xcb_composite_unredirect_subwindows(con, kwinApp()->x11RootWindow(), | 434 | xcb_composite_unredirect_subwindows(con, kwinApp()->x11RootWindow(), | ||
429 | XCB_COMPOSITE_REDIRECT_MANUAL); | 435 | XCB_COMPOSITE_REDIRECT_MANUAL); | ||
430 | } | 436 | } | ||
431 | while (!workspace()->deletedList().isEmpty()) { | 437 | while (!workspace()->deletedList().isEmpty()) { | ||
432 | workspace()->deletedList().first()->discard(); | 438 | workspace()->deletedList().first()->discard(); | ||
433 | } | 439 | } | ||
434 | } | 440 | } | ||
435 | 441 | | |||
436 | if (waylandServer()) { | 442 | if (waylandServer()) { | ||
437 | for (ShellClient *c : waylandServer()->clients()) { | 443 | for (ShellClient *c : waylandServer()->clients()) { | ||
438 | m_scene->removeToplevel(c); | 444 | m_scene->removeToplevel(c); | ||
439 | } | 445 | } | ||
440 | for (ShellClient *c : waylandServer()->internalClients()) { | | |||
441 | m_scene->removeToplevel(c); | | |||
442 | } | | |||
443 | for (ShellClient *c : waylandServer()->clients()) { | 446 | for (ShellClient *c : waylandServer()->clients()) { | ||
444 | c->finishCompositing(); | 447 | c->finishCompositing(); | ||
445 | } | 448 | } | ||
446 | for (ShellClient *c : waylandServer()->internalClients()) { | | |||
447 | c->finishCompositing(); | | |||
448 | } | | |||
449 | } | 449 | } | ||
450 | 450 | | |||
451 | delete m_scene; | 451 | delete m_scene; | ||
452 | m_scene = nullptr; | 452 | m_scene = nullptr; | ||
453 | compositeTimer.stop(); | 453 | compositeTimer.stop(); | ||
454 | repaints_region = QRegion(); | 454 | repaints_region = QRegion(); | ||
455 | 455 | | |||
456 | m_state = State::Off; | 456 | m_state = State::Off; | ||
▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Line(s) | 736 | { | |||
749 | if (auto *server = waylandServer()) { | 749 | if (auto *server = waylandServer()) { | ||
750 | const auto &clients = server->clients(); | 750 | const auto &clients = server->clients(); | ||
751 | auto test = [](ShellClient *c) { | 751 | auto test = [](ShellClient *c) { | ||
752 | return c->readyForPainting() && !c->repaints().isEmpty(); | 752 | return c->readyForPainting() && !c->repaints().isEmpty(); | ||
753 | }; | 753 | }; | ||
754 | if (std::any_of(clients.begin(), clients.end(), test)) { | 754 | if (std::any_of(clients.begin(), clients.end(), test)) { | ||
755 | return true; | 755 | return true; | ||
756 | } | 756 | } | ||
757 | const auto &internalClients = server->internalClients(); | 757 | } | ||
758 | auto internalTest = [](ShellClient *c) { | 758 | const auto &internalClients = workspace()->internalClients(); | ||
759 | return c->isShown(true) && !c->repaints().isEmpty(); | 759 | auto internalTest = [] (InternalClient *client) { | ||
760 | return client->isShown(true) && !client->repaints().isEmpty(); | ||||
760 | }; | 761 | }; | ||
761 | if (std::any_of(internalClients.begin(), internalClients.end(), internalTest)) { | 762 | if (std::any_of(internalClients.begin(), internalClients.end(), internalTest)) { | ||
762 | return true; | 763 | return true; | ||
763 | } | 764 | } | ||
764 | } | | |||
765 | return false; | 765 | return false; | ||
766 | } | 766 | } | ||
767 | 767 | | |||
768 | void Compositor::setCompositeTimer() | 768 | void Compositor::setCompositeTimer() | ||
769 | { | 769 | { | ||
770 | if (m_state != State::On) { | 770 | if (m_state != State::On) { | ||
771 | return; | 771 | return; | ||
772 | } | 772 | } | ||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |