favicons and flicker in the window bar

Aaron J. Seigo aseigo at olympusproject.org
Sun Jul 21 09:43:34 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi...

the perception of the speed of an interface can be highly subjective. things 
like flickering can lead to people perceiving the interface to be slower or 
even less stable! 

i noticed tonight that konqueror loads a website with a favicon it changes the 
window and location bar icons at least once, sometimes 2-3 times! this 
flickering really detracts from an otherwise rather smooth browser.

i tried looking into the favicon support and iconChanged() seems to be emitted 
on every request made, which in turn causes notifyChange() in 
KonqPixmapProvider to be called regularly, which eventually filters out to 
KonqMainwindow... i tried a few changes in the favicon / pixmap provider 
level with mixed results, but i'm really not familiar with the ramifications 
of all of those changes nor did i arrive at something that i felt comfortable 
with. so i'm hoping to turn this over to someone with a greater understanding 
of all the issues.

i have attached a patch to konq_mainwindow.cc that removes the flicker, though 
at the cost of two convertToImage() calls on the icons and an image 
comparison  .. expensive stuff ... but the perceived difference is 
noticeable, at least to me. if you are wondering if it is worthwhile to try 
and rectify this issue, pls apply this patch and see if it makes a difference 
to you =)

take care ....


Index: konq_mainwindow.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.cc,v
retrieving revision 1.1023
diff -u -3 -d -p -r1.1023 konq_mainwindow.cc
- --- konq_mainwindow.cc  2002/07/19 12:31:36     1.1023
+++ konq_mainwindow.cc  2002/07/21 08:31:44
@@ -52,8 +52,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>

- -#include <qfile.h>
 #include <qclipboard.h>
+#include <qfile.h>
+#include <qimage.h>
 #include <qmetaobject.h>
 #include <qvbox.h>
 #include <qlayout.h>
@@ -3849,16 +3850,18 @@ void KonqMainWindow::closeEvent( QCloseE

 void KonqMainWindow::setIcon( const QPixmap& pix )
 {
- -  KParts::MainWindow::setIcon( pix );
- -
- -  QPixmap big = pix;
- -
+  if (KWin::icon( winId(), pix.width(), pix.height()).convertToImage() == 
pix.convertToImage())
+    return;
+
   QString url = m_combo->currentText();
- -
- -  if ( !url.isEmpty() )
- -    big = KonqPixmapProvider::self()->pixmapFor( url, KIcon::SizeMedium );
+  KParts::MainWindow::setIcon( pix );

- -  KWin::setIcons( winId(), big, pix );
+  if ( url.isEmpty() )
+    KWin::setIcons( winId(), pix, pix );
+  else
+    KWin::setIcons( winId(),
+                    KonqPixmapProvider::self()->pixmapFor( url, 
KIcon::SizeMedium ),
+                    pix );
 }

 void KonqMainWindow::slotIntro()

- -- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

"Everything should be made as simple as possible, but not simpler"
    - Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9OnQ31rcusafx20MRAm/pAJ9oDTaVGd/F2mG+TqBcTiCoLGM12wCfSsqr
NzyzNvu0XvHA/1HzKQeSxI8=
=zWb8
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list