From d3af55709914b29b681993d795b8c67e5b6c6b54 Mon Sep 17 00:00:00 2001 From: Nikos Chantziaras Date: Thu, 16 Aug 2012 01:05:33 +0300 Subject: [PATCH] Ignore HFrame resize events with an invalid size No idea why that happens sometimes, but it does (we get negative values for width or height.) --- src/hframe.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hframe.cc b/src/hframe.cc index 67966be..c498f3b 100644 --- a/src/hframe.cc +++ b/src/hframe.cc @@ -157,6 +157,13 @@ HFrame::paintEvent( QPaintEvent* ) void HFrame::resizeEvent( QResizeEvent* e ) { + // Ignore invalid resizes. No idea why that happens sometimes, but it + // does (we get negative values for width or height.) + if (not e->size().isValid()) { + e->ignore(); + return; + } + // Save a copy of the current pixmap. const QPixmap& tmp = this->fPixmap.copy();