Bug 72203

Summary: Toolbar repaint with Plastik style lags behind window frame
Product: [Frameworks and Libraries] kdelibs Reporter: Rayiner Hashem <gtg990h>
Component: kstyleAssignee: Karol Szwed <gallium>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Rayiner Hashem 2004-01-09 01:10:11 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          g++ 3.3.3 
OS:          Linux

When resizing a window with the Plastik style, there will be a lag between the time Qt repaints the toolbar using the button color, and the time the style fills it with the background color. This causes the toolbar to "creep" across the screen as the window is enlarged. The fix is simple. A patch based on Mosfet Liquid's fix for the problem follows:

---------------- cut here ----------------

--- plastik/plastik.cpp	2004-01-04 11:18:46.000000000 -0500
+++ plastik-custom2/plastik.cpp	2004-01-09 18:44:21.000000000 -0500
@@ -1566,7 +1566,11 @@
     // --------------------
         case PE_PanelMenuBar:
         case PE_PanelDockWindow: {
-            p->fillRect(r, cg.background() );
+            // fix for toolbar lag (from Mosfet Liquid)
+            QWidget* w = (QWidget*)p->device();
+            if(w->backgroundMode() == PaletteButton)
+                w->setBackgroundMode(PaletteBackground);
+            p->fillRect(r, cg.brush(QColorGroup::Background));
 
             if ( _drawToolBarSeparator ) {
                 if ( r.width() > r.height() ) {

--------------- cut here -----------------

The problem can also be fixed by changing the background mode of toolbar widgets in QStyle::polish(), but that method does not work for KOffice apps, which seem to change the background-mode of their toolbars after polish() is called.
Comment 1 Sandro Giessl 2004-01-21 17:29:24 UTC
Thanks!