Bug 348012 - Opening files arbitrarily switches to other Activities
Summary: Opening files arbitrarily switches to other Activities
Status: CONFIRMED
Alias: None
Product: kactivitymanagerd
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Ivan Čukić
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-20 14:38 UTC by Ancoron
Modified: 2022-08-15 11:52 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
ericedlund2017: Usability+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ancoron 2015-05-20 14:38:06 UTC
In this case I am currently talking about "kate", but this actually applies to almost any application that might be activated by a URL or associated with a specific file mime type (e.g. web browsers or applications for specific file formats, aso.).

So, the problem is that it always depends in which Activity an application has been started first, which will then be re-used when opening files (e.g. a text file for Kate from within Dolphin) or URL's (e.g. clicking a link for Firefox from e.g. Quassel).

A specific example:
I have 3 Activities:
1. "Casual" - for general browsing, mails and other home stuff
2. "Development" - for development purposes incl. IDEs, Kate, various IRC channels with Quassel
3. "Management" - for local and remote management applications and tasks

Let's consider I start the day by starting the computer and login. This usually brings me to the first Activity, in which the following applications get opened automatically (assuming that this works):
* Firefox
* Dolphin
* Thunderbird
* Okular containing some ebook

At some point while reading some mails, I want to open an attachment which is a text file. But oops, instead of opening an instance of Kate inside the Activity I am currently operating in I get myself switched into the "Development" Activity and cannot read the rest of the mail, because Thudnerbird still is on Activity "Casual", of course. So, I close the document inside the Kate in the "Development" Activity, switch back to the "Casual" Activity, open a second instance of Kate and click again on the mail attachment: whooosh! On Activity "Development" again... closing document, switch back to "Casual", now trying to drag'n'drop the attachment from Thunderbird to the Kate instance: errrh.... "Malformed URL %001%008%006%001%004."??? OK... taking a deep breath, clicking the attachment, clicking "Save File...", navigating to /tmp/ to save it, inside Kate saying "File" > "Open...", navigating to /tmp/ and open the file. Wow! Finally...

After drinking the morning coffee I am going to do something productive, so I switch to the "Development" Activity, which has the following applications opened:
* IDE
* Kate containing some source files
* Quassel logs into some IRC channels
* Konsole

After some time of coding, I need to get some more information from the net, so I open a new Firefox instance for it. Then, I see an interesting link in one the IRC channels, which makes me click the URL. And guess what? Yes, I am back to Activity "Casual", because that's where the first instance of Firefox was started. So closing that page, back to "Development", copying the URL from the IRC channel, opening a new tab the the Firefox instance, pasting the URL and viola! I can read where I expected to (within the context of the IRC channel discussion).

Some time later, I need to prepare some VM's for some upcoming tasks, so I switch to the "Management" Activity and start setting up those. While getting into application specific setups, I need to get some further information which is available to me with a PDF file. You'll get it! Yes, while opening the PDF file from within a Dolphin instance in the "Management" Activity, I see myself being switched to the "Casual" Activity where the first instance of Okular is running.

...and this continues all day long...

So, I initially thought that the KDE Activities where supposed to present customizable working areas, as I read out from the following places conceptually:
* https://userbase.kde.org/Glossary#Activities
* https://userbase.kde.org/Plasma#Activities

Apparently, it turns out that Activities are not really useful in any way to separate activity as it seems to only separate things like desktop settings and its widgets, so pretty much like the virtual desktops with individual widgets in KDE SC 4.

Reproducible: Always

Steps to Reproduce:
1. create two activities
2. start Kate in activity #2
3. open a text file associated with Kate inside activity #1

Actual Results:  
1. see yourself being switched to activity #2
2. context information (that made you open the text file in the first place) is lost

Expected Results:  
1. new instance of Kate created inside activity #1 or already existing instance re-used
2. activities are never switched automatically
Comment 1 Ancoron 2015-05-20 14:43:21 UTC
I was considering to use Activities also at my work place to isolate sensitive information that I need to handle with special care (on a social level). The automatic switching of Activities due to the behavior as described by example above makes the use of Activities for this purpose more than inappropriate as I cannot always know (or remember) in advance to which Activity a click on a file or URL I will be taken to.

This can easily lead to accidental information disclosure.
Comment 2 Ivan Čukić 2015-11-14 17:53:00 UTC
The issue is that some applications do not want to open a new window when you open a file - they reuse an existing window and request for it to get focussed - the window manager obeys and switches the activity.

This needs to be patched in those applications.

I'm leaving it open in kactivities even if it is not the problem of kactivities.
Comment 3 Gaël de Chalendar (aka Kleag) 2020-05-29 18:29:02 UTC
I confirm the problem. I wanted to report it but this bug report is very comprehensive. I'm myself usually annoyed by pdf files downloaded from Firefox opening in my Work activity even if I'm currently in the Home one.

This is quite annoying.

If the problem comes from applications, even if this bug is in kactivitymanagerd, then the application maintainers should be aware of the bug. Is there hash tags we could add for example?

Or maybe should we open bug reports on each application and make this one a duplicate?