Bug 58121 - location address textbox/dropdown flickers too much
Summary: location address textbox/dropdown flickers too much
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 59578 59771 64349 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-04 22:18 UTC by lenar
Modified: 2008-02-18 09:32 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lenar 2003-05-04 22:18:35 UTC
Version:            (using KDE KDE 3.1.1)
Installed from:    Debian testing/unstable Packages

Location dropdown opens itself when you type an url into it 
showing you quick links (history). now, even though the content of it doesn't change,
while i'm adding characters to url it flickers - seems it clears itself and adds items again.
This happens also when only one item is showed: http://www.my_entered_text.

This should by changed so that no clearing/re-adding/redrawing happens when the actual
content doesn't change.

Current behavior in annoying and changing it only adds more polished look/feel to konq.
Comment 1 Maksim Orlovich 2003-06-21 06:02:36 UTC
*** Bug 59578 has been marked as a duplicate of this bug. ***
Comment 2 Maksim Orlovich 2003-06-21 06:19:01 UTC
Subject: kdelibs/kdeui

CVS commit by orlovich: 

While I am near this class, implement the excellent suggestion by lenar 
at-the-host city with-tld ee in #58121 -- to reduce the completion box flicker, 
check whether we actually changed anything when updating the box before triggering a 
repaint. Not enough to fix all cases, but in some makes things a lot smoother
CCMAIL:58121@bugs.kde.org


  M +25 -3     kcompletionbox.cpp   1.74


--- kdelibs/kdeui/kcompletionbox.cpp  #1.73:1.74
@@ -424,5 +424,12 @@ class KCompletionBoxItem : public QListB
 {
 public:
-    void reuse( const QString &text ) { setText( text ); }
+    //Returns true if dirty.
+    bool reuse( const QString& newText ) 
+    {   
+        if ( text() == newText )
+            return false;
+        setText( newText ); 
+        return true;
+    }
 };
 
@@ -447,13 +454,26 @@ void KCompletionBox::setItems( const QSt
     }
     else {
+        //Keep track of whether we need to change anything,
+        //so we can avoid a repaint for identical updates,
+        //to reduce flicker
+        bool dirty = false;
         for ( QStringList::ConstIterator it = items.begin(); it != items.end(); it++) {
             if ( item ) {
-                ((KCompletionBoxItem*)item)->reuse( *it );
+                bool changed = ((KCompletionBoxItem*)item)->reuse( *it );
+                dirty = dirty || changed;
                 item = item->next();
             }
             else {
+                dirty = true;
+                //Inserting an item is a way of making this dirty
                 insertItem( new QListBoxText( *it ) );
             }
         }
+        
+        //If there is an unused item, mark as dirty -> less items now
+        if ( item ) {
+            dirty = true; 
+        }
+
         QListBoxItem* tmp = item;
         while ( (item = tmp ) ) {
@@ -461,4 +481,6 @@ void KCompletionBox::setItems( const QSt
             delete item;
         }
+        
+        if (dirty)
         triggerUpdate( false );
     }


Comment 3 Maksim Orlovich 2003-06-21 18:46:30 UTC
*** Bug 59771 has been marked as a duplicate of this bug. ***
Comment 4 Wilco Greven 2003-09-18 21:48:04 UTC
*** Bug 64349 has been marked as a duplicate of this bug. ***
Comment 5 lenar 2003-10-17 16:09:43 UTC
It's much better now in KDE CVS (from september 2003). Actually I don't see any behavior which I would consider bad. So. Resolved? At least in upcoming 3.2.
Comment 6 lenar 2003-10-17 16:30:33 UTC
Actually it seems when the contents changes unneccessary repaints are happening.
Even if the resultcount remains the same (was www. and after keypress www.e). Seems that box is cleared and then new string added back. It should be done so that only one repaint is needed (with new image and without visible all-clearing step).

But it's still better than before. Thanks.
Comment 7 Enrico Ros 2004-06-13 11:26:17 UTC
A big problem is that the location box gets repainted from 2 to 4 times on each update! Probably a single repaint can fix the flickering.. investigating now.
Comment 8 Yves Glodt 2005-05-09 20:11:27 UTC
Any news about this?

Today I ran KDE 3.4 in vmware (kubuntu) and there more flicker than in my usual
debian was visible...
(maybe caused by the less-performant vmware graphics adapter)

So I guess on systems with lower graphics performance this is still bothering
Comment 9 George Goldberg 2008-02-18 03:56:59 UTC
Is this bug still present in a recent KDE version, such as 3.5.9 or 4.0.1?
Comment 10 lenar 2008-02-18 09:32:07 UTC
Quick testing shows that it seems to be fixed in 3.5.8. I can't notice any flickering. Might be also that my computer at this time is immensely quicker than the one I had when reporting this bug. But the probability is small.