Bug 336266

Summary: When switching activities, cannot open the virtual desktop last used with that activity
Product: [Plasma] plasma4 Reporter: sparhawk <kdebugs>
Component: activitiesAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: chanika, ivan.cukic, oliver.bobo2, scarpino
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description sparhawk 2014-06-15 14:50:55 UTC
KDE 4.13.2 (it wasn't an option in the drop down).

I have the "Virtual desktop switcher" activity plugin activated. "When switching to an activity, opens the virtual desktop last used with that activity". This doesn't work at all. When I switch activities, it just keeps me on the same virtual desktop as the previous activity that I had just switched from.

Reproducible: Always

Steps to Reproduce:
1. Be on activity A and virtual desktop 1.
2. Switch to activity B, then switch to virtual desktop 2.
3. Switch back to activity A.
Actual Results:  
Be on activity A and virtual desktop 2.

Expected Results:  
Be on activity A and virtual desktop 1.

Previously (perhaps one or two KDE versions ago?), this worked most of the time. It was always a bit buggy when using the shortcut to "Activate Window Demanding Attention", but mostly it worked.
Comment 1 revilo77 2014-07-01 13:54:31 UTC
I have the same issue as well, also using Archlinux. However, it might be caused by a rather specific combination of packages. I am using KDE 4.13.2.

When using package kactivities 4.13.2, the workspace switcher activity plugin works as intended.

When using kactivities 4.100 from Frameworks 5, the bug is always reproducible -- when switching to another activity, workspace is not switched to the one previously used in that activity.

@sparhawk: What kactivites package version are you using ?
Comment 2 Ivan Čukić 2014-07-01 16:43:30 UTC
The plugin in question is not yet ported to the Frameworks 5 version.

It should be available in the version after 5.0.
Comment 3 sparhawk 2014-07-02 00:44:14 UTC
revilo77, apparently I have kactivities-frameworks 4.100.0-2

$ pacman -Ss kactivities
extra/kactivities-frameworks 4.100.0-2 (kf5) [installed]
    The KActivity Manager Daemon
extra/kactivities4 4.13.2-1
    The KActivity Manager Daemon
extra/libkactivities4 4.13.2-1 [installed]
    API for using and interacting with the Activity Manager

Do you know how to switch back to using kactivities4 instead of kactivities-frameworks? The Arch packages link to https://projects.kde.org/projects/kde/kdelibs/kactivities , which 404s.

Ivan Čukić, thanks for the info. (It's a bit unintuitive that I can still select this plug in, though.)
Comment 4 revilo77 2014-07-02 08:51:12 UTC
> Do you know how to switch back to using kactivities4 instead of
> kactivities-frameworks? The Arch packages link to
> https://projects.kde.org/projects/kde/kdelibs/kactivities , which 404s.

Yes, the upstream url is wrong for some reason, but the kactivities4 package is fine. Simply install it with pacman:
pacman -S kactivities4, then confirm the removal of kactivities-framework, which conflicts with kactivities4
Comment 5 Ivan Čukić 2014-07-02 09:57:27 UTC
> Do you know how to switch back to using kactivities4 instead of kactivities-frameworks?

You can pull it from the kactivities repository, branch KDE/4.13

> It's a bit unintuitive that I can still select this plug in, though.

This only means that you have files remaining from the previous version. The new version does not yet provide any configuration dialogues.
Comment 6 sparhawk 2014-07-03 12:13:32 UTC
revilo77, I followed your advice and installed kactivities4, removing kactivities-framework. (I was confused because pacman says that kactivities4 only conflicts with kactivities, which doesn't exist. However, you were correct. When I installed it, it did prompt removal of kactivities-framework).

I then ran `kbuildsycoca4 ; kquitapp plasma-desktop ; sleep 2 ; kstart plasma-desktop`. However the bug is still here.

Ivan Čukić, thanks again. I'd prefer to install from the Arch repositories for the moment, assuming this works. Also, I think that the plug-in window is confusing if it doesn't complain about previously-installed plug-ins that don't work any more (especially when they are installed by default).
Comment 7 Ivan Čukić 2014-07-03 12:42:31 UTC
Your package manager should have uninstalled those plugins, along with the activities configuration altogether. So, you should not even have that configuration dialogue.

That is, System Settings from 4.x will never show the configuration for 5.x.
Comment 8 sparhawk 2014-07-04 12:44:47 UTC
Hm, it seems that a restart (or at least logging out and back in) was necessary for this re-install to work.

Ivan Čukić, okay, I guess it's a problem with the Arch packages then. It's odd though, since it's a fresh Arch install from a month or so ago. I just checked through my installation notes, and realised that Arch gave me the choice of either of these packages when I installed kde-meta. I picked poorly, it seems. :)

Thanks to both of you for the help.
Comment 9 Ivan Čukić 2014-07-04 15:11:40 UTC
Reopening - it needs to remind me to port the rest of plugins to kactivities-framework :)

> I picked poorly, it seems. :)

Heh, depends. The new service still does not have all the plugins the old one had, but it has its improvements. When the plugins get ported, it will be the officially advised version.
Comment 10 sparhawk 2014-07-05 06:00:37 UTC
I was being semi-facetious; I'm sure it'll be better in the long run, but for the moment, I miss the small enhancements. Thanks again.
Comment 11 sparhawk 2015-01-24 21:06:30 UTC
I upgraded my Arch installation today, which prompted me to replace kactivities4 with kactivities-frameworks. I thought I'd test it, but this bug is still unfixed.

I'm only mentioning this, because kactivities4 is no longer compatible with the latest version of other packages (in Arch). Specifically,
    error: failed to prepare transaction (could not satisfy dependencies)
    :: gwenview: requires kactivities-frameworks
    :: plasma-framework: requires kactivities-frameworks

Since I use activities as an extra layer of virtual desktops, the lack of this plugin makes them useless for me, since I cannot switch back and forth with ease. I will have to stop using activities in the meantime, and create more virtual desktops.
Comment 12 Ivan Čukić 2015-01-24 22:10:27 UTC
The bug is fixed. You just need to activate the plugin from the systemsettings5 or by running kcmshell5 activities, and to restart kactivitymanagerd.
Comment 13 sparhawk 2015-01-24 23:03:32 UTC
Thanks for the reply. However, I'm still not sure how to activate it.

With an up-to-date Arch installation, I only have `systemsettings`, and `kcmshell4`. In any case, I tried opening system settings and manually unchecking then rechecking the plugin, then selecting apply. I then ran `kactivitymanagerd stop` then `kactivitymanagerd start`, then `kbuildsycoca4 ; kquitapp plasma-desktop ; sleep 2 ; kstart plasma-desktop`, but it was still broken.
Comment 14 Ivan Čukić 2015-01-24 23:13:03 UTC
If Arch does not ship kcm from kf5, you'll need to do this manually. The old kcm uses the old configuration file at .kde/share/config/activitymanagerrc.

You need to edit .config/kactivitymanagerdrc and specify which plugins to enable.

[Plugins]
org.kde.ActivityManager.VirtualDesktopSwitchEnabled=true
Comment 15 sparhawk 2015-01-25 06:31:28 UTC
In Arch, I only have `~/.kde4`, not `~/.kde`. FWIW I can see the old configuration file at `~/.kde4/share/config/activitymanagerrc`. I created a new file at `~/.kde4/share/config/kactivitymanagerdrc` containing your two lines above, and did `kactivitymanagerd stop`, `kactivitymanagerd start`, then `kbuildsycoca4 ; kquitapp plasma-desktop ; sleep 2 ; kstart plasma-desktop`. Nothing changed.

I wasn't sure if that was a typo in the file name, so I created `kactivitymanagerrc` as well (no "d"), then ran the three commands, but again nothing changed.
Comment 16 revilo77 2015-01-25 08:16:25 UTC
That config file should go to ~/.config/ not ~/.kde4/share/config
All of the apps, plugins etc. built using KDE Frameworks 5 store config files in ~/.config
Comment 17 Andrea Scarpino 2015-01-26 08:25:14 UTC
(In reply to Ivan Čukić from comment #14)
> If Arch does not ship kcm from kf5, you'll need to do this manually. The old
> kcm uses the old configuration file at .kde/share/config/activitymanagerrc.

To let you (and others people) know: Arch does ship them; they are in systemsettings and kde-cli-tools packages.
Comment 18 sparhawk 2015-01-26 09:54:58 UTC
Thanks for the comments. I can confirm that this works, i.e. appending the two lines to the existing file at `~/.config/kactivitymanagerdrc` then running `kactivitymanagerd stop`, `kactivitymanagerd start`, then `kbuildsycoca4 ; kquitapp plasma-desktop ; sleep 2 ; kstart plasma-desktop`.
Comment 19 Ivan Čukić 2015-01-26 15:46:54 UTC
@Andrea Scarpino

Thanks for the note - I'll try to remember it for the future reference :)