Changeset View
Changeset View
Standalone View
Standalone View
composite.cpp
Show First 20 Lines • Show All 528 Lines • ▼ Show 20 Line(s) | 522 | { | |||
---|---|---|---|---|---|
529 | 529 | | |||
530 | if (effects) { // start() may fail | 530 | if (effects) { // start() may fail | ||
531 | effects->reconfigure(); | 531 | effects->reconfigure(); | ||
532 | } | 532 | } | ||
533 | } | 533 | } | ||
534 | 534 | | |||
535 | void Compositor::addRepaint(int x, int y, int w, int h) | 535 | void Compositor::addRepaint(int x, int y, int w, int h) | ||
536 | { | 536 | { | ||
537 | if (!hasScene()) | 537 | if (m_state != State::On) { | ||
538 | return; | 538 | return; | ||
539 | } | ||||
539 | repaints_region += QRegion(x, y, w, h); | 540 | repaints_region += QRegion(x, y, w, h); | ||
540 | scheduleRepaint(); | 541 | scheduleRepaint(); | ||
541 | } | 542 | } | ||
542 | 543 | | |||
543 | void Compositor::addRepaint(const QRect& r) | 544 | void Compositor::addRepaint(const QRect& r) | ||
544 | { | 545 | { | ||
545 | if (!hasScene()) | 546 | if (m_state != State::On) { | ||
546 | return; | 547 | return; | ||
548 | } | ||||
547 | repaints_region += r; | 549 | repaints_region += r; | ||
548 | scheduleRepaint(); | 550 | scheduleRepaint(); | ||
549 | } | 551 | } | ||
550 | 552 | | |||
551 | void Compositor::addRepaint(const QRegion& r) | 553 | void Compositor::addRepaint(const QRegion& r) | ||
552 | { | 554 | { | ||
553 | if (!hasScene()) | 555 | if (m_state != State::On) { | ||
554 | return; | 556 | return; | ||
557 | } | ||||
555 | repaints_region += r; | 558 | repaints_region += r; | ||
556 | scheduleRepaint(); | 559 | scheduleRepaint(); | ||
557 | } | 560 | } | ||
558 | 561 | | |||
559 | void Compositor::addRepaintFull() | 562 | void Compositor::addRepaintFull() | ||
560 | { | 563 | { | ||
561 | if (!hasScene()) | 564 | if (m_state != State::On) { | ||
562 | return; | 565 | return; | ||
566 | } | ||||
563 | const QSize &s = screens()->size(); | 567 | const QSize &s = screens()->size(); | ||
564 | repaints_region = QRegion(0, 0, s.width(), s.height()); | 568 | repaints_region = QRegion(0, 0, s.width(), s.height()); | ||
565 | scheduleRepaint(); | 569 | scheduleRepaint(); | ||
566 | } | 570 | } | ||
567 | 571 | | |||
568 | void Compositor::timerEvent(QTimerEvent *te) | 572 | void Compositor::timerEvent(QTimerEvent *te) | ||
569 | { | 573 | { | ||
570 | if (te->timerId() == compositeTimer.timerId()) { | 574 | if (te->timerId() == compositeTimer.timerId()) { | ||
▲ Show 20 Lines • Show All 400 Lines • ▼ Show 20 Line(s) | 974 | if (scene()->usesOverlayWindow() && !isOverlayWindowVisible()) { | |||
971 | // Return since nothing is visible. | 975 | // Return since nothing is visible. | ||
972 | return; | 976 | return; | ||
973 | } | 977 | } | ||
974 | Compositor::performCompositing(); | 978 | Compositor::performCompositing(); | ||
975 | } | 979 | } | ||
976 | 980 | | |||
977 | bool X11Compositor::checkForOverlayWindow(WId w) const | 981 | bool X11Compositor::checkForOverlayWindow(WId w) const | ||
978 | { | 982 | { | ||
979 | if (!hasScene()) { | 983 | if (!scene()) { | ||
980 | // No scene, so it cannot be the overlay window. | 984 | // No scene, so it cannot be the overlay window. | ||
981 | return false; | 985 | return false; | ||
982 | } | 986 | } | ||
983 | if (!scene()->overlayWindow()) { | 987 | if (!scene()->overlayWindow()) { | ||
984 | // No overlay window, it cannot be the overlay. | 988 | // No overlay window, it cannot be the overlay. | ||
985 | return false; | 989 | return false; | ||
986 | } | 990 | } | ||
987 | // Compare the window ID's. | 991 | // Compare the window ID's. | ||
988 | return w == scene()->overlayWindow()->window(); | 992 | return w == scene()->overlayWindow()->window(); | ||
989 | } | 993 | } | ||
990 | 994 | | |||
991 | bool X11Compositor::isOverlayWindowVisible() const | 995 | bool X11Compositor::isOverlayWindowVisible() const | ||
992 | { | 996 | { | ||
993 | if (!hasScene()) { | 997 | if (!scene()) { | ||
994 | return false; | 998 | return false; | ||
995 | } | 999 | } | ||
996 | if (!scene()->overlayWindow()) { | 1000 | if (!scene()->overlayWindow()) { | ||
997 | return false; | 1001 | return false; | ||
998 | } | 1002 | } | ||
999 | return scene()->overlayWindow()->isVisible(); | 1003 | return scene()->overlayWindow()->isVisible(); | ||
1000 | } | 1004 | } | ||
1001 | 1005 | | |||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |