Bug 327539 - [desktop grid] Desktop highlight lost if cursor moves too fast
Summary: [desktop grid] Desktop highlight lost if cursor moves too fast
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-window-management (show other bugs)
Version: 4.11.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-13 01:06 UTC by Andreas Klöckner
Modified: 2013-11-24 14:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.11.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Klöckner 2013-11-13 01:06:21 UTC
If I activate the desktop grid and then press "Cursor down" a few times reasonably quickly, then the highlight indicating which workspace is currently selected will disappear. Hitting Enter (as in, going back to full-size desktops) will show me what workspace is selected, but from the grid, I am unable to tell.

Reproducible: Always
Comment 1 Andreas Klöckner 2013-11-13 01:07:13 UTC
Not sure if it makes a difference, but I use a two-screen xinerama-ish multihead setup.
Comment 2 Martin Flöser 2013-11-13 05:58:55 UTC
I can trigger this problem also just with moving the mouse
Comment 3 Thomas Lübking 2013-11-13 13:46:48 UTC
Reason is obvious. Patch (not tested)

diff --git a/kwin/effects/desktopgrid/desktopgrid.cpp b/kwin/effects/desktopgrid/desktopgrid.cpp
index 7a53b52..e801653 100644
--- a/kwin/effects/desktopgrid/desktopgrid.cpp
+++ b/kwin/effects/desktopgrid/desktopgrid.cpp
@@ -914,7 +914,12 @@ void DesktopGridEffect::setHighlightedDesktop(int d)
 {
     if (d == highlightedDesktop || d <= 0 || d > effects->numberOfDesktops())
         return;
+    if (highlightedDesktop > 0 && highlightedDesktop <= hoverTimeline.count())
+        hoverTimeline[highlightedDesktop-1]->setCurrentTime(qMin(hoverTimeline[highlightedDesktop-1]->currentTime(),
+                                                                 hoverTimeline[highlightedDesktop-1]->duration()));
     highlightedDesktop = d;
+    if (highlightedDesktop <= hoverTimeline.count())
+        hoverTimeline[highlightedDesktop-1]->setCurrentTime(qMax(hoverTimeline[highlightedDesktop-1]->currentTime(), 0));
     effects->addRepaintFull();
 }


Time is added and removed from the timeline unclamped what can result in

currentTime = 0 - nextTimeAdd
-> currentTime = 0
-> repaint condition for active timeline not met.
Comment 4 Martin Flöser 2013-11-13 19:05:10 UTC
ShipIt (TM)
Comment 5 Thomas Lübking 2013-11-24 14:28:29 UTC
Git commit 746e93521cf24eef12b97a27e352288a1db4d1c1 by Thomas Lübking.
Committed on 16/11/2013 at 15:37.
Pushed by luebking into branch 'KDE/4.11'.

clamp timeline time for highlighted desktop
FIXED-IN: 4.11.4

M  +5    -0    kwin/effects/desktopgrid/desktopgrid.cpp

http://commits.kde.org/kde-workspace/746e93521cf24eef12b97a27e352288a1db4d1c1