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

List:       kde-panel-devel
Subject:    Re: Review Request: Fixes for screen hotplugging
From:       "Chani Armitage" <chanika () gmail ! com>
Date:       2010-06-24 6:59:25
Message-ID: 20100624065925.29149.49955 () localhost
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4451/#review6253
-----------------------------------------------------------


thanks for tackling this :)

there are other situations where the screen # may already be set - when you=
 import a containment, either by starting a stopped activity or some other =
way. there are a couple of functions for that in libplasma (Corona iirc -lo=
ad/importLayout?) that would need patching. you'd also have to apply the sa=
me logic to anywhere a *desktop* number could remain set, because PDV has t=
he same problem (turn it on, remove a VD, add a VD, no view).

however, I'm thinking that this isn't the best way to solve it - you'd alwa=
ys be looking over your shoulder wondering if you'd missed a way for the sc=
reen or desktop # to get set. It might be better to do it the way that (iir=
c) panel views do it: when desktopcorona checks the screens, it fakes a con=
tainmentAdded, and that leads to plasmaapp putting the containment in the v=
iew-creation queue.

...or hell, maybe it would make more sense for plasmaapp to just ensure tha=
t the views exist as soon as the screen/desktop does, and trust the view an=
d containment to find each other? take a step back and think about what wou=
ld be most reliable and simple. The codebase for multiscreen/desktop has gr=
own rather organically, and needs a bit of review now :)

- Chani


On 2010-06-24 01:37:15, Anthony Bryant wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4451/
> -----------------------------------------------------------
> =

> (Updated 2010-06-24 01:37:15)
> =

> =

> Review request for Plasma.
> =

> =

> Summary
> -------
> =

> This patch fixes a few problems that occur when hotplugging screens:
> 1. On startup, existing containments are associated with a screen even if=
 that screen does not exist.
>    This causes a bug when a screen is added: since the containment alread=
y thinks it is associated with the new screen,
>    it doesn't emit screenChanged() with the new screen, and doesn't get a=
 view created for it.
>    To fix this, I've made Containment::setScreen() set the new screen to =
-1 if it doesn't exist.
> 2. When a screen is removed, a containment will remain associated with th=
e screen that it is on, causing the same bug
>    as in 1 when the screen is added again.
>    To fix this, I've made sure a containment's screen is set to -1 when i=
ts view is removed by PlasmaApp.
> 3. PlasmaApp tries to connect to a nonexistent signal in Kephal: screenAd=
ded(int), the real one is screenAdded(Kephal::Screen*)
> =

> I'm not completely sure that this is the best way of fixing these problem=
s, please correct me if it isn't.
> =

> =

> Diffs
> -----
> =

>   /trunk/KDE/kdebase/workspace/plasma/desktop/shell/plasmaapp.h 1141983 =

>   /trunk/KDE/kdebase/workspace/plasma/desktop/shell/plasmaapp.cpp 1141983 =

>   /trunk/KDE/kdelibs/plasma/containment.cpp 1141983 =

> =

> Diff: http://reviewboard.kde.org/r/4451/diff
> =

> =

> Testing
> -------
> =

> Started plasma with and without an external screen and tried adding and r=
emoving it a few times.
> =

> =

> Thanks,
> =

> Anthony
> =

>


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://reviewboard.kde.org/r/4451/">http://reviewboard.kde.org/r/4451/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre>thanks for tackling this :)

there are other situations where the screen # may already be set - when you import a \
containment, either by starting a stopped activity or some other way. there are a \
couple of functions for that in libplasma (Corona iirc -load/importLayout?) that \
would need patching. you&#39;d also have to apply the same logic to anywhere a \
*desktop* number could remain set, because PDV has the same problem (turn it on, \
remove a VD, add a VD, no view).

however, I&#39;m thinking that this isn&#39;t the best way to solve it - you&#39;d \
always be looking over your shoulder wondering if you&#39;d missed a way for the \
screen or desktop # to get set. It might be better to do it the way that (iirc) panel \
views do it: when desktopcorona checks the screens, it fakes a containmentAdded, and \
that leads to plasmaapp putting the containment in the view-creation queue.

...or hell, maybe it would make more sense for plasmaapp to just ensure that the \
views exist as soon as the screen/desktop does, and trust the view and containment to \
find each other? take a step back and think about what would be most reliable and \
simple. The codebase for multiscreen/desktop has grown rather organically, and needs \
a bit of review now :)</pre>  <br />







<p>- Chani</p>


<br />
<p>On June 24th, 2010, 1:37 a.m., Anthony Bryant wrote:</p>




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Plasma.</div>
<div>By Anthony Bryant.</div>


<p style="color: grey;"><i>Updated 2010-06-24 01:37:15</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0;">This patch fixes a few problems that occur \
when hotplugging screens: 1. On startup, existing containments are associated with a \
screen even if that screen does not exist.  This causes a bug when a screen is added: \
since the containment already thinks it is associated with the new screen,  it \
doesn&#39;t emit screenChanged() with the new screen, and doesn&#39;t get a view \
created for it.  To fix this, I&#39;ve made Containment::setScreen() set the new \
screen to -1 if it doesn&#39;t exist. 2. When a screen is removed, a containment will \
remain associated with the screen that it is on, causing the same bug  as in 1 when \
the screen is added again.  To fix this, I&#39;ve made sure a containment&#39;s \
screen is set to -1 when its view is removed by PlasmaApp. 3. PlasmaApp tries to \
connect to a nonexistent signal in Kephal: screenAdded(int), the real one is \
screenAdded(Kephal::Screen*)

I&#39;m not completely sure that this is the best way of fixing these problems, \
please correct me if it isn&#39;t.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0;">Started plasma with and without an external \
screen and tried adding and removing it a few times.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/KDE/kdebase/workspace/plasma/desktop/shell/plasmaapp.h <span \
style="color: grey">(1141983)</span></li>

 <li>/trunk/KDE/kdebase/workspace/plasma/desktop/shell/plasmaapp.cpp <span \
style="color: grey">(1141983)</span></li>

 <li>/trunk/KDE/kdelibs/plasma/containment.cpp <span style="color: \
grey">(1141983)</span></li>

</ul>

<p><a href="http://reviewboard.kde.org/r/4451/diff/" style="margin-left: 3em;">View \
Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
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