Bug 176765 - Task Manager applet does not show tasks from correct screen
Summary: Task Manager applet does not show tasks from correct screen
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-taskbar (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-03 03:33 UTC by Josh Stewart
Modified: 2009-03-22 20:31 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot example of the problem (347.29 KB, image/png)
2008-12-03 03:41 UTC, Josh Stewart
Details
Screenshot displaying problem (285.42 KB, image/jpeg)
2009-02-04 16:22 UTC, mchugh19@yahoo.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Stewart 2008-12-03 03:33:10 UTC
Version:            (using Devel)
Compiler:          Using Project Neon nightly snapshots 
OS:                Linux
Installed from:    Compiled sources

I have a dual screen setup with a panel at the bottom of each screen. Both panels contain a Task Manager applet that is set to display only tasks from the current desktop and current screen.

The current desktop setting works OK, however current screen does not. The tasks on the right hand screen appear in the left hand task man and vice versa. I have tried moving the applets around however I cannot successfully get an applet from one panel moved to another. 

The separation of tasks on one screen from the other is OK, its just that each list appears on the wrong screen.
Comment 1 Josh Stewart 2008-12-03 03:41:10 UTC
Created attachment 29006 [details]
Screenshot example of the problem
Comment 2 Josh Stewart 2008-12-03 10:28:06 UTC
Just to provide some further info for this:
* All windows are maximised or clearly on one page only (ie they are not partially appearing on both screens)
* Moving a window from the left screen to the right causes its entry to move from the right to the left panel, so it will always be in the wrong location. 
* Removing the applets and placing them back on does not correct the problem. The order they are placed on (ie right then left or left then right) also makes no difference
Comment 3 Daniel Thaler 2009-01-12 10:16:39 UTC
Same here
I'm running the 4.1.96 packages from Arch Linux

I have 2 screens:
On the left I have my notebook, right of it is the external TFT
The Intel graphics chip numbers the external monitor as output 1 (primary), while the built-in display is output 2.

If I change the position of the screens via xrandr (xrandr --output LVDS --right-of TMDS-1), the task manager starts showing the correct windows.

This leads me to the assumption that the task manager is making incorrect assumptions/guesses which screen is which.
Comment 4 Jon Severinsson 2009-01-18 10:49:21 UTC
I have the same problem, with the addition that if I move a window between two screens it will *not* move from one taskbar to the other. So if I move every window to the oposite screen of where it started, the taskbars get the correct window list...

This is with KDE 4.1.96 installed using gentoo ebuilds. KDE 4.1.3 worked correctly.
Comment 5 clcevboxvjeo 2009-01-29 11:30:51 UTC
I have the same problem in KDE 4.2.0 final. I have notebook (LVDS) + VGA with a panel and taskbar on each of them. I have these settings on both of them:
Don't group
Don't sort
Only show tasks from curr. desktop
Only show tasks from curr. screen

The tasks from a screen appear on the taskbar which is on the other screen.
Comment 6 clcevboxvjeo 2009-01-29 16:06:08 UTC
*** This bug has been confirmed by popular vote. ***
Comment 7 mchugh19@yahoo.com 2009-02-04 16:22:42 UTC
Created attachment 30961 [details]
Screenshot displaying problem

I have the same problem. Note in the screen shot that adept is on the left monitor while it is displayed in the task manager from the right monitor. Additionally there seems to be corruption which looks like two task managers overlapping on the left monitor. I was able to correct this once by swapping the panels on each monitor, but eventually the problem returns.
Comment 8 Gabriel Klein 2009-02-06 10:54:38 UTC
Same here. Reproduced with both Debian experimental as well as Kubuntu packages.
Comment 9 Gabriel Klein 2009-03-06 16:15:29 UTC
The bug is still present in the 4.2.1 Kubuntu experimental packages. The task manager code between 4.2.1 and 4.1.4 seems identical with regard to screen numbers, and the QT function checking whether two rectangles overlap seems correct as well. Something I haven't been able to check is whether KDE some sets its screen geometry wrongly. Anybody?

An extremely ugly but effective hack that worked for me is to patch kdebase-workspace-x.y.z/libs/taskmanager/taskmanager.cpp with the following patch:

--- taskmanager.cpp.old 2009-03-06 16:13:35.000000000 +0100
+++ taskmanager.cpp     2009-03-06 13:51:41.000000000 +0100
@@ -511,7 +511,7 @@
     QRect window = wi.frameGeometry();
     QRect desktop = QApplication::desktop()->screenGeometry(screen);
     desktop.adjust(5, 5, -5, -5);
-    return window.intersects(desktop);
+    return !window.intersects(desktop);
 }

 int TaskManager::currentDesktop() const

As I said, it's ugly :) And I imagine it could cause problems in monitor setups with > 2 monitors.
Comment 10 Aike J Sommer 2009-03-09 11:02:15 UTC
This is fixed in trunk, problem was the use of QDesktopWidget, which doesnt share the same screen-ids as kephal which is used in plasma.
Comment 11 Aike J Sommer 2009-03-22 20:31:52 UTC
SVN commit 942882 by asommer:

Backport 937005.

Query screen-geometry from kephal instead of QDesktopWidget, this makes "only 
current screen"-setting work as expected.
BUG:176765

 M  +4 -0      CMakeLists.txt  
 M  +3 -1      taskmanager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=942882