[Konsole-devel] [Bug 54230] konsole flickers when resizing

Kurt V.Hindenburg kurt.hindenburg at kdemail.net
Tue Jul 4 21:51:37 UTC 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=54230         




------- Additional Comments From kurt.hindenburg kdemail net  2006-07-04 23:51 -------
SVN commit 558206 by hindenburg:

Test patch to reduce flickering; patch by Andreas Kling.

CCBUG: 54230


 M  +43 -1     TEWidget.cpp  


--- trunk/KDE/kdebase/apps/konsole/konsole/TEWidget.cpp #558205:558206
 @ -336,7 +336,7  @
 /* ------------------------------------------------------------------------- */
 
 TEWidget::TEWidget(QWidget *parent)
-:QFrame(parent)
+:QFrame(parent,Qt::WNoAutoErase)
 ,font_h(1)
 ,font_w(1)
 ,font_a(1)
 @ -1012,6 +1012,48  @
   }
 
   drawFrame( &paint );
+
+  // Since we're using WNoAutoErase, we have to make sure that
+  // every single pixel is painted by the paint event.
+  // To do this, we must figure out which pixels are left in the
+  // area between the terminal image and the frame border.
+
+  // Calculate the contents rect excluding scroll bar.
+  QRect innerRect = contentsRect();
+  if( scrollLoc != SCRNONE )
+    innerRect.setWidth( innerRect.width() - scrollbar->width() );
+
+  innerRect.setWidth( innerRect.width() + 3 );
+  innerRect.setHeight( innerRect.height() );
+
+  // Calculate the emulation rect (area needed for actual terminal contents)
+  QRect emurect( contentsRect().topLeft(), QSize( columns * font_w + 2 * rimX, lines * font_h + 2 * rimY ));
+
+  // Now erase() the remaining pixels on all sides of the emulation
+
+  // Top
+  QRect er( innerRect );
+  er.setBottom( emurect.top() );
+  erase( er );
+
+  // Bottom
+  er.setBottom( innerRect.bottom() );
+  er.setTop( emurect.bottom() );
+  erase( er );
+
+  // Left
+  er.setTop( emurect.top() );
+  er.setBottom( emurect.bottom() - 1 );
+  er.setRight( emurect.left() );
+  erase( er );
+
+  // Right
+  er.setRight( innerRect.right() );
+  er.setTop( emurect.top() );
+  er.setBottom( emurect.bottom() - 1 );
+  er.setLeft( emurect.right() );
+  erase( er );
+
   paint.end();
 }



More information about the konsole-devel mailing list