diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-08-01 12:20:19 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-08-01 12:20:19 +0200 |
| commit | 5d666781f2188e143d75aebdcd935adac19c6c9e (patch) | |
| tree | dbdc84844bb9b697dd638eed6a3431a5594aa813 /decorations | |
| parent | 8c93e42d50ae5c13a91411df92eb312b9b29f042 (diff) | |
DecoratedWindow: avoid deferencing an invalid shadow texture ptr, and split functions
Fixes LP: #1608464 (bzr r4163.1.1)
Diffstat (limited to 'decorations')
| -rw-r--r-- | decorations/DecoratedWindow.cpp | 10 | ||||
| -rw-r--r-- | decorations/DecorationsPriv.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/decorations/DecoratedWindow.cpp b/decorations/DecoratedWindow.cpp index 9d983a277..da4c4d743 100644 --- a/decorations/DecoratedWindow.cpp +++ b/decorations/DecoratedWindow.cpp @@ -510,9 +510,14 @@ bool Window::Impl::IsRectangular() const GLTexture* Window::Impl::ShadowTexture() const { - if (!IsRectangular()) + if (shaped_shadow_pixmap_) return shaped_shadow_pixmap_->texture(); + return SharedShadowTexture(); +} + +GLTexture* Window::Impl::SharedShadowTexture() const +{ auto const& mi = manager_->impl_; if (active() || parent_->scaled()) return mi->active_shadow_pixmap_->texture(); @@ -581,7 +586,7 @@ void Window::Impl::ComputeShadowQuads() return; } - const auto* texture = ShadowTexture(); + const auto* texture = SharedShadowTexture(); if (!texture || !texture->width() || !texture->height()) return; @@ -712,6 +717,7 @@ void Window::Impl::ComputeShapedShadowQuad() if (!last_shadow_rect_.isEmpty()) last_shadow_rect_.setGeometry(0, 0, 0, 0); + shaped_shadow_pixmap_ = nullptr; return; } diff --git a/decorations/DecorationsPriv.h b/decorations/DecorationsPriv.h index 7380a3ce7..3faac1c73 100644 --- a/decorations/DecorationsPriv.h +++ b/decorations/DecorationsPriv.h @@ -120,6 +120,7 @@ private: bool ShouldBeDecorated() const; bool IsRectangular() const; GLTexture* ShadowTexture() const; + GLTexture* SharedShadowTexture() const; unsigned ShadowRadius() const; std::string const& GetMenusPanelID() const; |
