[PATCH] Multiscreen fix!

Marco Martin notmart at gmail.com
Fri Jan 30 20:10:53 CET 2009


On Friday 30 January 2009, Alessandro Diaferia wrote:
> As you can see from the sources Plasma::View uses
> QTimer::singleShot(0, this, SLOT(privateInit())) in the ctor but
> DesktopView calls adjustSize() in the ctor with no delay..
> This causes the fact that adjustSize() uses invalid information about
> the current screen to setup its size and makes my second screen
> disappear (or actually, with a wrong size/position).
> I managed to fix this giving a delay also to adjustSize() so that when
> it is called the correct information are already set (and screen()
> returns the correct number in this case).
> Hope this is ok to commit, since i'd like to have my screen back officially
> :P

to me seems correct, it's a bit tricky the fact that  privateinit was enqueued 
before so by enqueuing adjustsize  we are sure that it will be executed after, 
but i don't see other ways to achieve that, so just put a comment about that 
and i think it's good to go

Cheers,
Marco Martin

> Since i'm having troubles with the reviewboard here comes the patch:
>
> Index: shells/desktop/desktopview.cpp
> 
===================================================================
> --- shells/desktop/desktopview.cpp	(revision 918687)
> +++ shells/desktop/desktopview.cpp	(working copy)
> @@ -104,7 +104,7 @@ DesktopView::DesktopView(Plasma::Contain
>      QBrush b(tile);
>      setBackgroundBrush(tile);
>
> -    adjustSize();
> +    QTimer::singleShot(0, this, SLOT(adjustSize()));
>
>      Kephal::Screens *screens = Kephal::Screens::self();
>      connect(screens, SIGNAL(screenResized(Kephal::Screen *, QSize,
> QSize)),
>
>
> Hugs!!




More information about the Plasma-devel mailing list