0

Update: This question may have been driven by some bad assumptions. I've closed the loop with an answer. I'll leave the question in place in case anyone else jumps to similar conclusions (or can add any insight).


Most Linux desktop environments include the feature of multiple workspaces. My recollection is that until recently, all or most would "auto-focus". This is what I mean:

Say you have your email client open in workspace 1 and your web browser open in workspace 2. You are in your email client, and a message there contains a web link. The behavior used to be that clicking on the link took you to a view of it. That is, the link was opened in the browser and workspace 1 was automatically switched to workspace 2 to make the web page visible with just the original click on the link.

This behavior recently changed. With most desktop environments, the auto-focus stopped working. Clicking the link would open it in the browser, but the workspace action would be one of these:

  • No indication that anything happened, but if you switch to the browser's workspace, the link will be open there.
  • The system tray icon for the browser's workspace indicates a change there, like via changing color, but you must manually switch to that workspace to see it.
  • The browser gets sucked from its own workspace to the email client's workspace in front of the email client ready to view (then must be manually moved back to its own workspace).

This happened in KDE (my preferred DE), and I thought it was just a distro bug. I tried all of the major KDE distros (including Neon, which is KDE's own distro), and they were all the same. So maybe it was a KDE bug.

I started looking at other DEs to use until KDE got its act together. I don't know about Gnome (I find that impossible to use), but at least Mate, Xfce, LXDE, and LXQT all now also fail at auto-focus (across distros).

Cinnamon is the only major DE I found that still does it "correctly". Budgie works, although that project appears to be all but dead (and Ubuntu Budgie is buggy). Moksha works, but it's only available on Bodhi, and that distro is badly broken.

I'm not a big fan of Cinnamon, so I'm trying to dig deeper to figure out the common denominator. There is a relatively small collection of toolkits that all of these DE features are built from. Since this behavior change is so widespread and happened everywhere at the same time, I'm assuming the issue is with one of those underlying components. If I can identify it, it will make figuring out what will and won't work easier than trial and error, and provide a way to track progress. It also might contribute to getting the issue identified and resolved.

Does anyone know what subsystem is responsible for this workspace auto-focus action?

10
  • I've not seen that feature in action but curious, in which DE/distro version has that auto focus feature?
    – Biswapriyo
    Commented Apr 8, 2019 at 8:09
  • Have you tried checking those DE's settings..? I stopped using KDE few months ago, but till then auto-focus worked there perfectly. I switched from KDE to XFCE and ever since I've been using XFCE the auto-focus feature works perfectly, even now.
    – Fanatique
    Commented Apr 8, 2019 at 8:44
  • @Biswapriyo, my recollection is that this was the standard behavior for workspaces, with the possible exception of some featherweight DEs and distros. Over the years, I've dabbled with a lot of DEs and dozens of distros. Recent years it's been mostly KDE, mostly Mint, Kubuntu, Manjaro, PCLinuxOS. Now that you mention it, I can't bet the farm on having explicitly tested that on all of the DEs and distros I evaluated. (cont'd)
    – fixer1234
    Commented Apr 8, 2019 at 9:02
  • I guess what I'm relying on is the fact that I'm used to it working that way and it's very noticeable and irritating when it doesn't. Outside of what I've used day-to-day, I don't recall any of the others I dabbled with not performing as expected. So I may be extrapolating a little in generalizing.
    – fixer1234
    Commented Apr 8, 2019 at 9:02
  • @Fanatique, the plot thickens. Xfce is one of the DEs I was hoping would still work. I looked at a number of distros and none of those worked (Mint, Linux Lite, MX, and a few others). What distro are you using? What model computer? If Xfce works for you, I'm wondering if there is an additional factor driving the behavior (it might not be coincidence that openSUSE is doing some weird stuff related to my graphics hardware). BTW, I'm not aware of any settings for that behavior.
    – fixer1234
    Commented Apr 8, 2019 at 9:30

1 Answer 1

0

I'm going to close the loop on this. I'll leave the question in place in case someone can add some insight (or others jump to a similar conclusion), but it looks like what I was pursuing is a bust.

  1. It appears that anything related to workspace switching would be the responsibility of the window manager. Most of the desktop environments use different default window managers. So to the extent that behaviors might have changed across many DEs at about the same time would appear to be coincidence.

  2. There may not even have been coincidence. I may have been mistaken, or over-generalized, about the number of major DEs that changed behavior.

    I've dabbled with a lot of DEs, but have mainly used KDE in recent years. I didn't explicitly test this behavior in other DEs, rather recalled that I had never seen the lack of auto-focus in major ones I had used or tested. I suspect that I simply never used those other DEs for a purpose for which auto-focus would have been required. The recent testing made me aware that they don't do it now, and I may have jumped to conclusions.

It looks like the bottom line is that some do and some don't. The only one I'm sure changed behavior is KDE.

Lesson: be careful about checking your assumptions. It's easy to extrapolate patterns that may not exist.


Update:

This question was triggered by the change in auto-focus behavior in KDE. While this question turned out to be a bust, the original problem was solved. In case anyone lands here with the same problem, here's the underlying issue.

I couldn't find any documentation that the automated focus switching in KDE is an explicit feature. It may have just been a beneficial quirk whose behavior changed due to an unrelated modification.

KDE has had a feature since at least KDE4, called focus stealing prevention. This was added to fix the problem of pop-ups or poorly behaved applications suddenly stealing focus from what you're working on. Some recent change in that (improvements and possibly the default level setting?), affected applications being activated by another application as opposed to being explicitly clicked on by the user.

Setting focus stealing prevention to none allows this to work as it used to. It can be done as a blanket policy in System Settings, or limited to just a specific application, like the browser (which minimizes loss of the focus stealing prevention feature in places where it's actually beneficial).

The solution detail can be found at KDE no longer automatically switches desktops. I'll need to investigate further to see if any of the other DEs that don't auto focus are affected by the same type of feature, and could benefit from a similar fix.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .