[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    [PATCH] Multiscreen fix!
From:       Alessandro Diaferia <alediaferia () gmail ! com>
Date:       2009-01-30 14:13:29
Message-ID: 65627f3a0901300613u2980915bv5bef96e3bf370aab () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

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!!

-- 
Alessandro Diaferia

[Attachment #5 (text/html)]

<pre style="display: block;" id="description"><font style="font-family: \
arial,helvetica,sans-serif;" size="2">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..<br> 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).<br>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).<br> Hope this is ok to commit, since i&#39;d like to have my screen back \
officially :P<br><br>Since i&#39;m having troubles with the reviewboard here comes \
the patch:<br><br>Index: \
shells/desktop/desktopview.cpp<br>===================================================================<br>
                
--- shells/desktop/desktopview.cpp	(revision 918687)<br>+++ \
shells/desktop/desktopview.cpp	(working copy)<br>@@ -104,7 +104,7 @@ \
DesktopView::DesktopView(Plasma::Contain<br>     QBrush b(tile);<br>     \
setBackgroundBrush(tile);<br>  <br>-    adjustSize();<br>+    QTimer::singleShot(0, \
this, SLOT(adjustSize()));<br> <br>     Kephal::Screens *screens = \
Kephal::Screens::self();<br>     connect(screens, SIGNAL(screenResized(Kephal::Screen \
*, QSize, QSize)),</font><br> </pre><br>Hugs!!<br clear="all"><br>-- <br>Alessandro \
Diaferia<br>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic