<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>76107</bug_id>
          
          <creation_ts>2004-02-25 12:33:39 +0000</creation_ts>
          <short_desc>Flicker in plastik and dotnet scrollbar</short_desc>
          <delta_ts>2004-09-11 18:15:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kdelibs</product>
          <component>kstyle</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Allan Sandfeld">kde</reporter>
          <assigned_to name="Sandro Giessl">sgiessl</assigned_to>
          <cc>clee</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>209658</commentid>
    <comment_count>0</comment_count>
    <who name="Allan Sandfeld">kde</who>
    <bug_when>2004-02-25 12:33:39 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources

When moving the slider up and down the scrollbar, there is noticeable flicker on the parts outside of the slider. This especially noticeable on homepages with scrollbar-colouring like osnews.com.

It happens in Plastik and .NET, but neither in Classic nor Keramik.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215269</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Lee">clee</who>
    <bug_when>2004-03-14 01:01:18 +0000</bug_when>
    <thetext>I can&apos;t reproduce this on my system. Can you go into a little more detail? Version of Qt, X server, video card? I&apos;d like to know how to reproduce this as I haven&apos;t ever seen it, but several users have reported it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215277</commentid>
    <comment_count>2</comment_count>
    <who name="Sandro Giessl">sgiessl</who>
    <bug_when>2004-03-14 01:46:32 +0000</bug_when>
    <thetext>&gt; ------- Additional Comments From clee kde org  2004-03-14 01:01
&gt; ------- I can&apos;t reproduce this on my system. Can you go into a little
&gt; more detail? Version of Qt, X server, video card? I&apos;d like to know
&gt; how to reproduce this as I haven&apos;t ever seen it, but several users
&gt; have reported it.

I finally managed to reproduce it with qt-copy, some recent 4.3 X server 
and nvidia binary drivers.
The problem is that in PE_ScrollBarAddPage/PE_ScrollBarSubPage we are 
painting some pixels two times; first with a solid background color and 
a few lines later with a light Dense4Pattern. This produces some 
flicker...
A simple pixmap buffer would do it, but in Plastik I&apos;m probably going to 
replace the Dense4Pattern stuff with something better. Sometime.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215343</commentid>
    <comment_count>3</comment_count>
    <who name="Allan Sandfeld">kde</who>
    <bug_when>2004-03-14 12:06:02 +0000</bug_when>
    <thetext>I have no problem reproducing the problem. I see it both on my home system:
KDE-HEAD
qt-copy-HEAD
Xfree 4.3 (and 4.4) with builtin 3dfx driver

And at the university with
KDE 3.2
Qt 3.2
And Sun&apos;s X-server (xwin) on Sunray terminals.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267716</commentid>
    <comment_count>4</comment_count>
    <who name="Sandro Giessl">sgiessl</who>
    <bug_when>2004-09-11 17:58:32 +0000</bug_when>
    <thetext>CVS commit by giessl: 

Draw PE_ScrollBarAddPage/PE_ScrollBarSubPage double buffered to avoid
flicker...

CCMAIL: 76107@bugs.kde.org


  M +27 -17    plastik.cpp   1.91


--- kdeartwork/styles/plastik/plastik.cpp  #1.90:1.91
@@ -1632,27 +1632,37 @@ void PlastikStyle::drawPrimitive(Primiti
         case PE_ScrollBarAddPage:
         case PE_ScrollBarSubPage: {
-            // TODO: imho this is somewhat strange... have a look at this later...
-            if (on || down) {
-                p-&gt;fillRect(r, QBrush(cg.mid().dark()));
+            // draw double buffered to avoid flicker...
+            QPixmap buffer;
+            if(flags &amp; Style_Horizontal) {
+                buffer.resize(2, r.width() );
             } else {
-                p-&gt;save();
+                buffer.resize(r.height(), 2 );
+            }
+            QRect br(buffer.rect() );
+            QPainter bp(&amp;buffer);
 
+            if (on || down) {
+                bp.fillRect(br, QBrush(cg.mid().dark()));
+            } else {
                 if(flags &amp; Style_Horizontal) {
-                    p-&gt;setPen(cg.background().dark(106));
-                    p-&gt;drawLine(r.left(), r.top(), r.right(), r.top());
-                    p-&gt;setPen(cg.background().light(106));
-                    p-&gt;drawLine(r.left(), r.bottom(), r.right(), r.bottom());
-                    p-&gt;fillRect(r.left(), r.top()+1, r.width(), r.height()-2,cg.background());
+                    bp.setPen(cg.background().dark(106));
+                    bp.drawLine(br.left(), br.top(), br.right(), br.top());
+                    bp.setPen(cg.background().light(106));
+                    bp.drawLine(br.left(), br.bottom(), br.right(), br.bottom());
+                    bp.fillRect(br.left(), br.top()+1, br.width(), br.height()-2,cg.background());
                 } else {
-                    p-&gt;setPen(cg.background().dark(106));
-                    p-&gt;drawLine(r.left(), r.top(), r.left(), r.bottom());
-                    p-&gt;setPen(cg.background().light(106));
-                    p-&gt;drawLine(r.right(), r.top(), r.right(), r.bottom());
-                    p-&gt;fillRect(r.left()+1, r.top(), r.width()-2, r.height(),cg.background());
+                    bp.setPen(cg.background().dark(106));
+                    bp.drawLine(br.left(), br.top(), br.left(), br.bottom());
+                    bp.setPen(cg.background().light(106));
+                    bp.drawLine(br.right(), br.top(), br.right(), br.bottom());
+                    bp.fillRect(br.left()+1, br.top(), br.width()-2, br.height(),cg.background());
                 }
-
-                p-&gt;restore();
             }
-            p-&gt;fillRect(r, QBrush(cg.background().light(), Dense4Pattern));
+
+            bp.fillRect(br, QBrush(cg.background().light(), Dense4Pattern));
+
+            bp.end();
+
+            p-&gt;drawTiledPixmap(r, buffer);
             break;
         }


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267721</commentid>
    <comment_count>5</comment_count>
    <who name="Sandro Giessl">sgiessl</who>
    <bug_when>2004-09-11 18:15:40 +0000</bug_when>
    <thetext>CVS commit by giessl: 

Same for dotNet: Draw PE_ScrollBarAddPage/PE_ScrollBarSubPage double buffered
to avoid flicker... 

CCMAIL: 76107-done@bugs.kde.org


  M +12 -3     dotnet.cpp   2.13


--- kdeartwork/styles/dotnet/dotnet.cpp  #2.12:2.13
@@ -471,10 +471,19 @@ void dotNETstyle::drawPrimitive(Primitiv
                 case PE_ScrollBarAddPage:
                 case PE_ScrollBarSubPage: {
+                        // draw double buffered to avoid flicker...
+                        QPixmap buffer(2,2);
+                        QRect br(buffer.rect() );
+                        QPainter bp(&amp;buffer);
+ 
                         if (on || down) {
-                                p-&gt;fillRect(r, QBrush(cg.mid().dark()));
+                                bp.fillRect(br, QBrush(cg.mid().dark()));
                         } else {
-                                p-&gt;fillRect(r, QBrush(cg.background()));
+                                bp.fillRect(br, QBrush(cg.background()));
                         }
-                        p-&gt;fillRect(r, QBrush(cg.background().light(), Dense4Pattern));
+                        bp.fillRect(br, QBrush(cg.background().light(), Dense4Pattern));
+
+                        bp.end();
+                        p-&gt;drawTiledPixmap(r, buffer);
+
                         break;
                 }


</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>