Bug 346878 - Setting task manager to only show applications on current screen (monitor) does not work properly, and will display applications not on that screen
Summary: Setting task manager to only show applications on current screen (monitor) do...
Status: RESOLVED DUPLICATE of bug 268259
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.3.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords: regression, usability
: 347661 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-04-29 00:49 UTC by Zachary Layne
Modified: 2015-05-31 20:32 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zachary Layne 2015-04-29 00:49:37 UTC
I have 2 monitors, and applications open on only one screen will appear in both of my task managers (I have one on each screen) even though I have both task managers set to only display applications on that screen.

Reproducible: Always

Steps to Reproduce:
1. Have 2 monitors
2. Set task manager to only show tasks from current screen
3. Task manager shows tasks from both screens

Actual Results:  
Tasks from both screens are displayed in both task managers

Expected Results:  
Only display tasks from current screen
Comment 1 Eike Hein 2015-04-29 01:29:32 UTC
Possible dupe of bug 336570.
Comment 2 Zachary Layne 2015-04-29 02:15:05 UTC
Hmm, the bug is different, though they may be related. That bug is the task manager not updating, while my bug is that even though my task managers are set to only display applications on that screen, they display applications on other screens, as well as one application that for some reason doesn't even show up in the task manager. This was not an issue upon upgrading to Kubuntu 15.04, but after using the backport ppa to update to Plasma 5.3, this bug has appeared.
Comment 3 Jens Müller 2015-05-09 07:01:18 UTC
I'm seeing this too on Ubuntu 15.04 (Version: 4:5.2.2-0ubuntu3 of plasma-workspace).
Comment 4 Eike Hein 2015-05-13 15:00:44 UTC
*** Bug 347661 has been marked as a duplicate of this bug. ***
Comment 5 Eike Hein 2015-05-19 13:33:23 UTC
Bug 336570 might be related.
Comment 6 Jens Müller 2015-05-24 07:20:02 UTC
What would be necessary for this bug to become CONFIRMED?
Comment 7 Eike Hein 2015-05-24 12:53:04 UTC
Personally the status doesn't matter much to me, my ticket searches list UNCONFIRMED as well. My problem is not having more than one screen myself.
Comment 8 Jens Müller 2015-05-31 18:14:25 UTC
What a pity ... Anyway, thanks for your efforts so far.

I started digging a bit into the code.

applets/taskmanager/package/contents/ui/ConfigGeneral.qml contains the setting in question:

                CheckBox {
                    id: showOnlyCurrentScreen
                    text: i18n("Show only tasks from the current screen")
                }

I grep'ed the whole repository git://anongit.kde.org/plasma-desktop for the string showOnlyCurrentScreen. I found a default value in applets/taskmanager/package/contents/config/main.xml:

    <entry name="showOnlyCurrentScreen" type="Bool">
      <default>false</default>
    </entry>

and a binding in applets/taskmanager/package/contents/ui/main.qml:

    Binding {
        target: backend.groupManager
        property: "showOnlyCurrentScreen"
        value: plasmoid.configuration.showOnlyCurrentScreen
    }

I would think that an actual _usage_ of this setting would also contain the string "showOnlyCurrentScreen" - but I could not find any further occurences of the string.

I also tried showOnlyCurrentDesktop and showOnlyCurrentActivity. For those, I could also find a usage in applets/taskmanager/package/contents/ui/Task.qml, but apparently that does not affect the filtering, but only the presentation of a single task.

I am bit confused now. Am I missing something obvious, or is it really so simple, i.e. the settings are not considered at all?
Comment 9 Eike Hein 2015-05-31 18:16:45 UTC
'backend.groupManager' is an instance of TaskManager::GroupManager from plasma-workspace' libtaskmanager. The Binding block you quoted binds its 'showOnlyCurrentScreen' property to the current configuration value. The setting is used just fine, in other words.
Comment 10 Jens Müller 2015-05-31 18:42:52 UTC
OK, I now found out that the usage apparently is in git://anongit.kde.org/plasma-workspace, namely in libtaskmanager/groupmanager.cpp. It's a bit hard to read this code, as there are nearly no comments at all ...

I looked at GroupManagerPrivate::addTask(::TaskManager::Task *task), and that looks ok by itself:

    if (showOnlyCurrentScreen && !task->isOnScreen(currentScreenGeometry)) {
        //qDebug() << "Not on this screen and showOnlyCurrentScreen";
        skip = true;
    }

I guess the code should be easy enough to debug - when one has set up the entire development environment ... :-/
Comment 11 Eike Hein 2015-05-31 18:49:40 UTC
It's relatively easy to do:

1. Clone plasma-workspace and plasma-desktop
2. Grab build dependencies (most distros have some equivalent to yum-builddep for this)
3. cd <clone>; mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/home/<user>/foo ../
4. cd into libtaskmanager/ and applets/taskmanager/ in the respective build dirs, run 'make install' within them to build and install only the lib and the applet into the prefix used above
5. Stuff something like https://paste.kde.org/puib5apru/siofmg into your /etc/profile.d/ or (smarter) into a *.sh file in ~/.config/plasma-workspace/env/ (mkdir if necessary)
6. Relogin
7. You're not using a self-built Task Manager
Comment 12 Eike Hein 2015-05-31 18:50:56 UTC
s/not/now/
Comment 13 Jens Müller 2015-05-31 19:53:07 UTC
Thanks, that indeed sounds relatively easy.

I have also tried out something else: 

When I de-maximize a window, it is no longer shown in the taskbar of the other screen. 

TaskManager::isOnScreen contains this:

    // for window decos that fudge a bit and claim to extend beyond the
    // edge of the screen, we just contract a bit.
    const QRect window = wi.frameGeometry();

    QRect desktop = screen;
    desktop.adjust(5, 5, -5, -5);

    return window.intersects(desktop);

I first thought it has something to do with that. But apparently that code has been in for a long time. Furthermore, when I drag a non-maximized window to the edge of the screen, it is _not_ shown in the task manager of the other screen (even though I do see a slight glow on the other screen in that case -- something that does not happen with a maximized window).
Comment 14 Jens Müller 2015-05-31 20:00:29 UTC
Bug 268259
Comment 15 David Edmundson 2015-05-31 20:18:30 UTC
FWIW, show only taks from the current screen is working here git master on a dual screen xrandr arrangement.
Comment 16 Jens Müller 2015-05-31 20:24:16 UTC
The workaround mentioned in Bug 268259 comment 43 works for me. So I would say this bug is a duplicate.
Comment 17 Eike Hein 2015-05-31 20:32:23 UTC
Many thanks for your investigative efforts Jens.

*** This bug has been marked as a duplicate of bug 268259 ***