summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-07-26 18:59:38 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-07-26 18:59:38 +0200
commitcd32d94f8f692d5dd9bc5814d60931f413712ca0 (patch)
tree9e78cac8273bd3d0dfbe173e0ec2647228191f69
parent4dfb2250ef355d596e9f601b857638a72937e289 (diff)
DecoratedWindow: don't try to draw an invalid texture
Fixes crash on shaped client unmap (bzr r4067.8.10)
-rw-r--r--decorations/DecoratedWindow.cpp12
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_)
{