From fe9092dd89c2af824beda1b2bd1e3d1f9e488a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 16 Dec 2008 20:48:34 +0000 Subject: [PATCH] Don't split window quads which have a size of zero. This should prevent crashes due to assert failing. BUG: 177927 svn path=/trunk/KDE/kdebase/workspace/; revision=897801 --- lib/kwineffects.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/kwineffects.cpp b/lib/kwineffects.cpp index 96973d2cb1..9e16e28058 100644 --- a/lib/kwineffects.cpp +++ b/lib/kwineffects.cpp @@ -597,6 +597,11 @@ WindowQuadList WindowQuadList::splitAtX( double x ) const ret.append( quad ); continue; } + if( quad.left() == quad.right() ) // quad has no size + { + ret.append( quad ); + continue; + } ret.append( quad.makeSubQuad( quad.left(), quad.top(), x, quad.bottom())); ret.append( quad.makeSubQuad( x, quad.top(), quad.right(), quad.bottom())); } @@ -628,6 +633,11 @@ WindowQuadList WindowQuadList::splitAtY( double y ) const ret.append( quad ); continue; } + if( quad.top() == quad.bottom() ) // quad has no size + { + ret.append( quad ); + continue; + } ret.append( quad.makeSubQuad( quad.left(), quad.top(), quad.right(), y )); ret.append( quad.makeSubQuad( quad.left(), y, quad.right(), quad.bottom())); }