[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Review Request: Add screen as member to Toplevel instead of rechecking each time
From: Thomas_Lübking <thomas.luebking () web ! de>
Date: 2012-03-29 8:28:56
Message-ID: 20120329082856.11401.74056 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104435/#review11971
-----------------------------------------------------------
kwin/toplevel.cpp
<http://git.reviewboard.kde.org/r/104435/#comment9465>
Too late.
setGeometry and plainResize internally require the screen up-to-date at=
an earlier time as they emit that signal, so checkScreen has to be called =
there right after adjusting the geometry and before doing all the checkWork=
space, checkActiveScreen, updatedRules, ... whatever stuff.
kwin/toplevel.cpp
<http://git.reviewboard.kde.org/r/104435/#comment9467>
Is this actually required?
(What does the desktop size have to do with the amount of screens or th=
e position of random windows?)
kwin/toplevel.cpp
<http://git.reviewboard.kde.org/r/104435/#comment9466>
_usually_ this is probably sufficiently initialized by setGeometry, BUT=
i currently don't know about popups etc. where the client may set the geom=
etry directly and the screen number would remain uninitialized.
=
-> what about initially invalidating screen() as -1, have screen() reca=
lculate it if invalid and invalidate it on geometry / screen count changes?
- Thomas L=C3=BCbking
On March 29, 2012, 6:45 a.m., Martin Gr=C3=A4=C3=9Flin wrote:
> =
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104435/
> -----------------------------------------------------------
> =
> (Updated March 29, 2012, 6:45 a.m.)
> =
> =
> Review request for kwin.
> =
> =
> Description
> -------
> =
> When the getter for Toplevel's screen was invoked the screen was actually=
calculated each time. Instead of this the number gets
> cached and only updated when the Toplevel's geometry changes or the numbe=
r of screens or their geometry.
> =
> Why did I do this change? For something new I want to experiment with I n=
eed a signal when the Toplevel's screen is changed.
> =
> =
> Diffs
> -----
> =
> kwin/toplevel.h 32581a5 =
> kwin/toplevel.cpp 00bd7dd =
> =
> Diff: http://git.reviewboard.kde.org/r/104435/diff/
> =
> =
> Testing
> -------
> =
> Currently running the patch on multi-screen setup and played around with =
resizing and desktop grid. It's on top of the kephal patches so I am testin=
g both.
> =
> =
> Thanks,
> =
> Martin Gr=C3=A4=C3=9Flin
> =
>
[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://git.reviewboard.kde.org/r/104435/">http://git.reviewboard.kde.org/r/104435/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/104435/diff/1/?file=55132#file55132line51" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/toplevel.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">Toplevel::Toplevel(Workspace* ws)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">51</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">connect</span><span class="p">(</span><span class="k">this</span><span \
class="p">,</span> <span class="n">SIGNAL</span><span class="p">(</span><span \
class="n">geometryChanged</span><span class="p">()),</span> <span \
class="n">SLOT</span><span class="p">(</span><span class="n">checkScreen</span><span \
class="p">()));</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Too late. \
setGeometry and plainResize internally require the screen up-to-date at an earlier \
time as they emit that signal, so checkScreen has to be called there right after \
adjusting the geometry and before doing all the checkWorkspace, checkActiveScreen, \
updatedRules, ... whatever stuff.</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/104435/diff/1/?file=55132#file55132line53" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/toplevel.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">Toplevel::Toplevel(Workspace* ws)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">53</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">connect</span><span class="p">(</span><span \
class="n">QApplication</span><span class="o">::</span><span \
class="n">desktop</span><span class="p">(),</span> <span class="n">SIGNAL</span><span \
class="p">(</span><span class="n">resized</span><span class="p">(</span><span \
class="kt">int</span><span class="p">)),</span> <span class="n">SLOT</span><span \
class="p">(</span><span class="n">checkScreen</span><span \
class="p">()));</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Is this \
actually required? (What does the desktop size have to do with the amount of screens \
or the position of random windows?)</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/104435/diff/1/?file=55132#file55132line365" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/toplevel.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
Toplevel::deleteEffectWindow()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">365</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">366</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="kt">void</span> <span class="n">Toplevel</span><span class="o">::</span><span \
class="n">checkScreen</span><span class="p">()</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">_usually_ \
this is probably sufficiently initialized by setGeometry, BUT i currently don't \
know about popups etc. where the client may set the geometry directly and the screen \
number would remain uninitialized.
-> what about initially invalidating screen() as -1, have screen() recalculate it \
if invalid and invalidate it on geometry / screen count changes?</pre> </div>
<br />
<p>- Thomas</p>
<br />
<p>On March 29th, 2012, 6:45 a.m., Martin Gräßlin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/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 kwin.</div>
<div>By Martin Gräßlin.</div>
<p style="color: grey;"><i>Updated March 29, 2012, 6:45 a.m.</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; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">When the getter for Toplevel's screen was invoked the screen was \
actually calculated each time. Instead of this the number gets cached and only \
updated when the Toplevel's geometry changes or the number of screens or their \
geometry.
Why did I do this change? For something new I want to experiment with I need a signal \
when the Toplevel's screen is changed.</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; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Currently running the patch on multi-screen setup and played around with \
resizing and desktop grid. It's on top of the kephal patches so I am testing \
both.</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>kwin/toplevel.h <span style="color: grey">(32581a5)</span></li>
<li>kwin/toplevel.cpp <span style="color: grey">(00bd7dd)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/104435/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic