[PATCH] fix plasma and Qt monitor-hotplug issues

Aike J Sommer dev at aikesommer.name
Mon Mar 31 14:31:02 CEST 2008


Am Freitag 28 März 2008 17:29:41 schrieb Aaron J. Seigo:
> On Friday 28 March 2008, Aike J Sommer wrote:
> > The patch to qt-copy fixes:
> > - screenResized not beeing emitted on some changes
> > - screenResized always reporting screen 0 to have changed
>
> this needs to go to Trolltech, and may already be out of date with the
> merging of patch 0172... i'll track down bhughes about this.
>
> > This is a little hacky... Qt uses Xinerama to query for screens, so
> > listening to XRandR 1.2 events doesnt really work...
>
> it uses xrandr in the latest upstream code afaik.

At least in the newest snapshots its still just Xinerama... Patch 0172 only 
changed the Xinerama code to better work with XRandR's Xinerama emulation.


>
> > The patch to kdebase basically only calls view->show() after creating
> > it...
>
> yes, this part looks good. pls commit.

Hmm... Dont have a svn-account... Should i apply for one that "early"??


> iterating over the screens isn't a very expensive set of operations
> (looping with an int, looping through our collection of containments) that
> is only done at startup and when the screen counts change. it ensures that
> it works no matter what happens elsewhere and makes the method more self
> contained (e.g. it's obvious on reading it that it works and what it does
> without having to read the rest of the code in the class), so the cost is
> well worth it imho.

Changed that part... Hope its okay now?!?! :-)

> > One thing left: Should views be destroyed if a monitor is disconnected?
> > And
>
> it's not required, but it would be cool if they did, yes.
>
> > if so i guess using screenOwnerChanged or a (new) signal
> > containmentRemoved wouldnt be right, since containments should stay
> > associated with the screen...
>
> this could probably be done easily as the else statement to:
>
> +    if (screen < QApplication::desktop()->numScreens())
>
> in DesktopCorona::screenResized, which can then emit a signal..
> screenRemoved() perhaps? i don't really like how it breaks the symmetry of
> responding to containmentAdded and screenOwnerChanged, but ... *shrug* it
> should worlk in any case.

I did it in RootWidget::adjustSize(screen), it just felt more at home 
there! ;-)

I also changed View::setContainment(containment) to allow unsetting of 
containments, probably isnt really needed, but i wanted to be sure...

:-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebase-patch-05.diff
Type: text/x-diff
Size: 4625 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080331/226b854b/attachment.bin 


More information about the Panel-devel mailing list