[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Review Request: Clear deleted window thumbnails
From: Martin_Gräßlin <kde () martin-graesslin ! com>
Date: 2011-08-30 5:35:14
Message-ID: 20110830053514.24852.33564 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On Aug. 26, 2011, 5:20 p.m., Thomas Lübking wrote:
> > kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp, line 122
> > <http://git.reviewboard.kde.org/r/102445/diff/1/?file=32940#file32940line122>
> >
> > No idea about the tabstrip, but this should in general likely be
> >
> > effects->addRepaint(w->geometry());
> >
> > yesno?
> >
>
> Martin Gräßlin wrote:
> I think both is wrong as we need to repaint the thumbnail area. I'm pretty sure that it worked for \
> sebas because on active the geometry of each window would include the thumbnail area.
> Oh and obviously the easiest solution to the question would be: w->addRepaintFull() ;-)
>
> Thomas Lübking wrote:
> Oh and obviously the easiest solution: EVIL TRAP!
> -------------------------------------------------
>
> void Toplevel::addRepaintFull()
> {
> repaints_region = decorationRect();
> workspace()->checkCompositeTimer();
> }
>
> and now guess who's gone in the next event cycle / paint (despite reviewboard's display, this is in the \
> deleted slot) :-P
> Martin Gräßlin wrote:
> *cough* I thought this results directly in a call to Workspace. /me thinks of updating the docu for \
> EffectWindow::addRepaint(Full)()
Here the proper patch - please give it a try if it fixes the problem for you
diff --git a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp \
b/kwin/effects/taskbarthumbnail/taskbarthum index c1cfdd1..5aa6048 100644
--- a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp
+++ b/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp
@@ -119,6 +119,13 @@ void TaskbarThumbnailEffect::slotWindowAdded(EffectWindow* w)
void TaskbarThumbnailEffect::slotWindowDeleted(EffectWindow* w)
{
+ foreach (EffectWindow *window, thumbnails.uniqueKeys()) {
+ foreach (const Data &thumb, thumbnails.values(window)) {
+ if (w == effects->findWindow(thumb.window)) {
+ window->addRepaint(thumb.rect);
+ }
+ }
+ }
thumbnails.remove(w);
}
- Martin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102445/#review6035
-----------------------------------------------------------
On Aug. 26, 2011, 2:57 p.m., Sebastian Kügler wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102445/
> -----------------------------------------------------------
>
> (Updated Aug. 26, 2011, 2:57 p.m.)
>
>
> Review request for kwin.
>
>
> Summary
> -------
>
> When thumbnails are shown and a window is deleted, only the other, still existing windows are being \
> repainted. The deleted window stays on the screen until repainted. In the typical taskbar thumbnail \
> case, that's not a problem, since the thumbnail of a deleted window is just never shown (no tooltips in \
> that case).
> In the Windowstrip applet, which is used as application switcher in Active, when the window strip is \
> not as wide as the screen, the windows shift left, leave a blank space on the right which doesn't get \
> cleared, so a ghost of the window stays on screen.
> The patch addresses this by adding the rect of the vanishing window to the area to repaint in the next \
> frame, essentially clearing exactly the part that we want.
> I'd like to commit to master and 4.7.
>
>
> Diffs
> -----
>
> kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp 7761ba5
>
> Diff: http://git.reviewboard.kde.org/r/102445/diff
>
>
> Testing
> -------
>
> start plasma-contour, with 3 open windows, close on of them from the windowstrip.
>
> Without the patch, you'll see 3 windows painted, the third of which gets cleared only after an \
> artificially triggered repaint, e.g. by dragging the rest of the windows over it.
> With the patch, behaviour is as expected, the preview of the rightmost window is cleared.
>
>
> Thanks,
>
> Sebastian
>
>
[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/102445/">http://git.reviewboard.kde.org/r/102445/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On August 26th, 2011, 5:20 p.m., <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<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/102445/diff/1/?file=32940#file32940line122" style="color: black; \
font-weight: bold; text-decoration: underline;">kwin/effects/taskbarthumbnail/taskbarthumbnail.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 \
TaskbarThumbnailEffect::slotWindowAdded(EffectWindow* w)</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">122</font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">effects</span><span \
class="o">-></span><span class="n">addRepaint</span><span class="p">(</span><span \
class="n">w</span><span class="o">-></span><span class="n">rect</span><span \
class="p">());</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: \
-o-pre-wrap; word-wrap: break-word;">No idea about the tabstrip, but this should in general likely be
effects->addRepaint(w->geometry());
yesno?
</pre>
</blockquote>
<p>On August 27th, 2011, 6:40 a.m., <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: \
-o-pre-wrap; word-wrap: break-word;">I think both is wrong as we need to repaint the thumbnail area. \
I'm pretty sure that it worked for sebas because on active the geometry of each window would include \
the thumbnail area.
Oh and obviously the easiest solution to the question would be: w->addRepaintFull() ;-)</pre>
</blockquote>
<p>On August 27th, 2011, 10:09 a.m., <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: \
-o-pre-wrap; word-wrap: break-word;">Oh and obviously the easiest solution: EVIL TRAP!
-------------------------------------------------
void Toplevel::addRepaintFull()
{
repaints_region = decorationRect();
workspace()->checkCompositeTimer();
}
and now guess who's gone in the next event cycle / paint (despite reviewboard's display, this is \
in the deleted slot) :-P</pre> </blockquote>
<p>On August 27th, 2011, 10:14 a.m., <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: \
-o-pre-wrap; word-wrap: break-word;">*cough* I thought this results directly in a call to Workspace. /me \
thinks of updating the docu for EffectWindow::addRepaint(Full)()</pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; \
white-space: -o-pre-wrap; word-wrap: break-word;">Here the proper patch - please give it a try if it \
fixes the problem for you
diff --git a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp \
b/kwin/effects/taskbarthumbnail/taskbarthum index c1cfdd1..5aa6048 100644
--- a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp
+++ b/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp
@@ -119,6 +119,13 @@ void TaskbarThumbnailEffect::slotWindowAdded(EffectWindow* w)
void TaskbarThumbnailEffect::slotWindowDeleted(EffectWindow* w)
{
+ foreach (EffectWindow *window, thumbnails.uniqueKeys()) {
+ foreach (const Data &thumb, thumbnails.values(window)) {
+ if (w == effects->findWindow(thumb.window)) {
+ window->addRepaint(thumb.rect);
+ }
+ }
+ }
thumbnails.remove(w);
}
</pre>
<br />
<p>- Martin</p>
<br />
<p>On August 26th, 2011, 2:57 p.m., Sebastian Kügler 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 Sebastian Kügler.</div>
<p style="color: grey;"><i>Updated Aug. 26, 2011, 2:57 p.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 thumbnails are shown and a window is \
deleted, only the other, still existing windows are being repainted. The deleted window stays on the \
screen until repainted. In the typical taskbar thumbnail case, that's not a problem, since the \
thumbnail of a deleted window is just never shown (no tooltips in that case).
In the Windowstrip applet, which is used as application switcher in Active, when the window strip is not \
as wide as the screen, the windows shift left, leave a blank space on the right which doesn't get \
cleared, so a ghost of the window stays on screen.
The patch addresses this by adding the rect of the vanishing window to the area to repaint in the next \
frame, essentially clearing exactly the part that we want.
I'd like to commit to master and 4.7.</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;">start plasma-contour, with 3 open windows, \
close on of them from the windowstrip.
Without the patch, you'll see 3 windows painted, the third of which gets cleared only after an \
artificially triggered repaint, e.g. by dragging the rest of the windows over it.
With the patch, behaviour is as expected, the preview of the rightmost window is cleared.</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/effects/taskbarthumbnail/taskbarthumbnail.cpp <span style="color: grey">(7761ba5)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/102445/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