Alien widgets and flickering

Louai Al-Khanji louai.khanji at
Mon Mar 17 13:38:26 GMT 2008

Hi all,

Most of you probably know that with Qt 4.4 the so-called "alien
widget" feature was introduced that avoids creating native windows for
QWidgets. Unfortunately this causes flickering when native windows are
required. This can easily be seen in System Settings for example. Just
start it up and select "Appearance", and it should flicker as X
windows are constructed. This is especially visible with dark color
schemes, because Qt currently hardcodes the X background color to
white. (And the border color is always black, this is a bug in

This is very visible even on a composited desktop. I have experimented
with setting the X background color to match the window palette, but
things still flicker because the whole widget area is redrawn with a
solid color anyway.

As far as I can see there are two solutions. One is to never call
QWidget::winId except for top-level windows. The other solution is to
throw away the advantages of alien widgets and disable them in
applications where native widgets are used.

In my case I am especially considering SystemSettings because the
flashing is really bugging me and I run into it often. I don't think
there is any way to avoid reparenting X windows for example in the
screensaver kcm, and I assume it won't be simple for kwin or style
kcm's either.

- Louai

More information about the kde-core-devel mailing list