Kephal or pager bug

Asraniel asraniel at fryx.ch
Thu Jul 1 10:15:21 CEST 2010


Hi,

i discovered yesterday that when i add or remove a screen on kde 4.5 rc1, the 
aspect ratio of the pager changes. This is the wanted behaviour. BUT, it only 
changes when i resize the panel at least one pixel after the screen change.
I the searched a little and thought that the pager does not get the screen 
added/removed singal. But it does.
I then saw this code:

qreal ratio = (qreal)Kephal::ScreenUtils::desktopGeometry().width() / 
(qreal)Kephal::ScreenUtils::desktopGeometry().height();

so, this takes the geometry of the desktop and calculates the ratio for the 
pager. Sounds absolutely correct. So why does it not do it?

I then outputed the Kephal::ScreenUtils::desktopGeometry() value, and 
discovered that even that we got the signal that a screen was added (or 
removed), that value was actually the old value before the change.

Kephal::ScreenUtils::numScreens() on the other hand returned the correct 
amount of screends.

I then changed the first code for the ration into the following:

QRect tempRect;
for(int i = 0; i < Kephal::ScreenUtils::numScreens(); i++){
     tempRect |= Kephal::ScreenUtils::screenGeometry(i);
}
    
qreal ratio = (qreal)tempRect.width() / (qreal)tempRect.height();

and everything worked perfectly.

Now, is this a kephal bug? or a qt bug? from looking at the code kephal does 
little more than use qdesktopwidget and send those signals to plasma.

I suspect that this could cause some of the other multiscreen bugs.

I didn't want to patch kephal, who knows, perhaps that is the wanted 
behaviour, so i could just patch the pager to work correctly.

Feedback?

have a nice day.


More information about the Plasma-devel mailing list