Changeset View
Changeset View
Standalone View
Standalone View
toplevel.cpp
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | |||||
141 | void Toplevel::disownDataPassedToDeleted() | 141 | void Toplevel::disownDataPassedToDeleted() | ||
142 | { | 142 | { | ||
143 | info = nullptr; | 143 | info = nullptr; | ||
144 | } | 144 | } | ||
145 | 145 | | |||
146 | QRect Toplevel::visibleRect() const | 146 | QRect Toplevel::visibleRect() const | ||
147 | { | 147 | { | ||
148 | QRect r = decorationRect(); | 148 | QRect r = decorationRect(); | ||
149 | if (hasShadow() && !shadow()->shadowRegion().isEmpty()) { | 149 | if (shadow() && !shadow()->shadowRegion().isEmpty()) { | ||
150 | r |= shadow()->shadowRegion().boundingRect(); | 150 | r |= shadow()->shadowRegion().boundingRect(); | ||
151 | } | 151 | } | ||
152 | return r.translated(geometry().topLeft()); | 152 | return r.translated(geometry().topLeft()); | ||
153 | } | 153 | } | ||
154 | 154 | | |||
155 | Xcb::Property Toplevel::fetchWmClientLeader() const | 155 | Xcb::Property Toplevel::fetchWmClientLeader() const | ||
156 | { | 156 | { | ||
157 | return Xcb::Property(false, window(), atoms->wm_client_leader, XCB_ATOM_WINDOW, 0, 10000); | 157 | return Xcb::Property(false, window(), atoms->wm_client_leader, XCB_ATOM_WINDOW, 0, 10000); | ||
▲ Show 20 Lines • Show All 415 Lines • ▼ Show 20 Line(s) | |||||
573 | { | 573 | { | ||
574 | return isOnScreen(screens()->current()); | 574 | return isOnScreen(screens()->current()); | ||
575 | } | 575 | } | ||
576 | 576 | | |||
577 | void Toplevel::getShadow() | 577 | void Toplevel::getShadow() | ||
578 | { | 578 | { | ||
579 | QRect dirtyRect; // old & new shadow region | 579 | QRect dirtyRect; // old & new shadow region | ||
580 | const QRect oldVisibleRect = visibleRect(); | 580 | const QRect oldVisibleRect = visibleRect(); | ||
581 | if (hasShadow()) { | 581 | if (shadow()) { | ||
582 | dirtyRect = shadow()->shadowRegion().boundingRect(); | 582 | dirtyRect = shadow()->shadowRegion().boundingRect(); | ||
583 | if (!effectWindow()->sceneWindow()->shadow()->updateShadow()) { | 583 | if (!effectWindow()->sceneWindow()->shadow()->updateShadow()) { | ||
584 | effectWindow()->sceneWindow()->updateShadow(nullptr); | 584 | effectWindow()->sceneWindow()->updateShadow(nullptr); | ||
585 | } | 585 | } | ||
586 | emit shadowChanged(); | 586 | emit shadowChanged(); | ||
587 | } else { | 587 | } else { | ||
588 | Shadow::createShadow(this); | 588 | Shadow::createShadow(this); | ||
589 | } | 589 | } | ||
590 | if (hasShadow()) | 590 | if (shadow()) | ||
591 | dirtyRect |= shadow()->shadowRegion().boundingRect(); | 591 | dirtyRect |= shadow()->shadowRegion().boundingRect(); | ||
592 | if (oldVisibleRect != visibleRect()) | 592 | if (oldVisibleRect != visibleRect()) | ||
593 | emit paddingChanged(this, oldVisibleRect); | 593 | emit paddingChanged(this, oldVisibleRect); | ||
594 | if (dirtyRect.isValid()) { | 594 | if (dirtyRect.isValid()) { | ||
595 | dirtyRect.translate(pos()); | 595 | dirtyRect.translate(pos()); | ||
596 | addLayerRepaint(dirtyRect); | 596 | addLayerRepaint(dirtyRect); | ||
597 | } | 597 | } | ||
598 | } | 598 | } | ||
599 | 599 | | |||
600 | bool Toplevel::hasShadow() const | | |||
601 | { | | |||
602 | if (effectWindow() && effectWindow()->sceneWindow()) { | | |||
603 | return effectWindow()->sceneWindow()->shadow() != nullptr; | | |||
604 | } | | |||
605 | return false; | | |||
606 | } | | |||
607 | | ||||
608 | Shadow *Toplevel::shadow() | 600 | Shadow *Toplevel::shadow() | ||
609 | { | 601 | { | ||
610 | if (effectWindow() && effectWindow()->sceneWindow()) { | 602 | if (effectWindow() && effectWindow()->sceneWindow()) { | ||
611 | return effectWindow()->sceneWindow()->shadow(); | 603 | return effectWindow()->sceneWindow()->shadow(); | ||
612 | } else { | 604 | } else { | ||
613 | return nullptr; | 605 | return nullptr; | ||
614 | } | 606 | } | ||
615 | } | 607 | } | ||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |