Saturday, August 12, 2006

the heart of kde3 is still beatin' ... in cleveland! detroit!

no, i'm not going to write about cleveland and detroit. the title of this entry is simply a riff on one of my favourite songs from the 80s. i am writing about touching kde3 code, though. kicker in specific.

andreas kling committed a number of fixes for crashes in the taskbar arising from the insanity of nested event loops with menus and the taskbar's incontinence when it comes to controlling when widgets and other objects get deleted thanks to trying to keep up with the random input of the window manager telling it whenever anything window related happens.

tonight someone came into #kde-devel on irc.freenode.net bitching about the performance of the pager. this caused maksim (sadeagle) to bitch at me. now, it was all good natured bitching but i hate it when people bitch at me ... and are right. (if you're wrong (or i believe you're wrong) i can be rather impervious) turns out the problem is mostly repaints on window movements.

so a few patches later and 100% of unnecessary repaints in the taskbar and pager along with many calls to the window manager for window info are eliminated when windows are moving and the pager isn't showing desktop previews (aka "drawing little windows"). when the taskbar is showing desktop previews, the number of redraws is cut by approximately 85%. this is significant because drawing these things isn't particularly cheap (the original complainer, er, bug reporter claimed to be able to actually see the flickering in the taskbar) and moving a window from one side of my screen to the other used to cause the pager to redraw over 100 times. now it only redraws around 15 times. huzzah.

so yes, kde3 continues to improve whilst kde4 takes shape. be sure to upgrade when the next 3.5.x release happens. after all, love is in the air.

4 comments:

Anonymous said...

Hi Aaron!

while you are at reducing unnecessary repaints... :-)

It feels for me that apart of the taskbar, which you fixed yesterday, there are a lot more than necessary redraws happening in the toolbars, the scrollbars, and the statusbars of many apps. I filed this bug yesterday:

https://bugs.kde.org/show_bug.cgi?id=132250


An example:
Open 2 tabs in konq, switch between them, and see the scrollbar and the
statusbar flicker due to ugly repaints :-(

My respect for your amazing work to KDE

Anonymous said...

Hey Aaron,

Can you suggest any good ways to detect extra repaints in 3.x? Something along the lines of the paint debugging environment variable in 4.x would be cool.

Rich.

Aaron J. Seigo said...

@Rich: the only thing i can think of is to take one of the styles and sloooooow it down artificially so that repainting of styled widgets is slow enough that one could see it visually.

perhaps do a fill with some garish colour (e.g. bright yellow) over the rect passed in before painting and then do a usleep() for a bit. may have to flush the painter as well. you'll probably end up with artifacts, depending on the style, but it should make repaints more obvious.

Anonymous said...

@Rich: You could also run KDE over a remote X11 display, that will also show slow repaints. --wilbert