diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-07-26 18:59:38 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-07-26 18:59:38 +0200 |
| commit | cd32d94f8f692d5dd9bc5814d60931f413712ca0 (patch) | |
| tree | 9e78cac8273bd3d0dfbe173e0ec2647228191f69 /decorations | |
| parent | 4dfb2250ef355d596e9f601b857638a72937e289 (diff) | |
DecoratedWindow: don't try to draw an invalid texture
Fixes crash on shaped client unmap (bzr r4067.8.10)
Diffstat (limited to 'decorations')
| -rw-r--r-- | decorations/DecoratedWindow.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/decorations/DecoratedWindow.cpp b/decorations/DecoratedWindow.cpp index 94162bd54..c9b4f650d 100644 --- a/decorations/DecoratedWindow.cpp +++ b/decorations/DecoratedWindow.cpp @@ -510,11 +510,14 @@ bool Window::Impl::IsRectangular() const GLTexture* Window::Impl::ShadowTexture() const { + if (!IsRectangular()) + return shaped_shadow_pixmap_->texture(); + auto const& mi = manager_->impl_; if (active() || parent_->scaled()) - return IsRectangular() ? mi->active_shadow_pixmap_->texture() : shaped_shadow_pixmap_->texture(); + return mi->active_shadow_pixmap_->texture(); - return IsRectangular() ? mi->inactive_shadow_pixmap_->texture() : shaped_shadow_pixmap_->texture(); + return mi->inactive_shadow_pixmap_->texture(); } unsigned Window::Impl::ShadowRadius() const @@ -798,7 +801,10 @@ void Window::Impl::Draw(GLMatrix const& transformation, } if (glwin_->vertexBuffer()->end()) - glwin_->glDrawTexture(ShadowTexture(), transformation, attrib, mask); + { + if (GLTexture* texture = ShadowTexture()) + glwin_->glDrawTexture(texture, transformation, attrib, mask); + } for (auto const& dtex : bg_textures_) { |
