Activities switching doesn't focus window in 'new' activity

Hi all,

I’m running Plasma 6.3.4, KDE Framework 6.13.0 on Manjaro with X11.

There are some situations where I actually use quite a lot both Virtual Desktops and Activities and Activity Switching with the keyboard (mapped to META + tab). The latter because I can create ‘contexts’ which are separate from each other in addition to Virtual Desktops.

Since a few Plasma updates I have a rather annoying bug where if I have already open windows on each activity, when switching from, say activity A to activity B, the window focus seems to remain to window on activity A, with the side effect of effectively start typing or clicking on the last focused window in activity A, which is the one I just ‘left’ and seeing activity B.
The only way is to e.g. minimize / maximise or focus / de focus the window in the ‘new’ activity.

I can’t unfortunately pin-point when this happened as it is a rather subtle issue, but around a couple of months ago.

Any help / idea appreciated.

Thanks
Lorenzo

Sounds like you are also running into 501393 – Window focus is lost after activity switch when using multiple activities and screens (Plasma 6.3.2, Frameworks 6.1.1, Qt 6.8.2)

Only workaround I have found so far (also in the ticket) is to switch virtual desktop before switching activity.

Quite annoying but better than interacting with an “unknown” window

1 Like

Thanks for the pointer, definitely seems to be that bug. The combination of virtual desktops makes it particularly hard to identify the exact pattern.

I saw your entry on the bug report and wondered why the workaround is not working for you.

Like yourself I am using Activities as a “second dimension”.
This is essentially how I even discovered the work around :slight_smile:

Plasma 6 lost the ability to treat Activity switching independent from Desktop switching so I started to always switch to Desktop 1 before switching Activity in order to have at least some resemblance of reliability on where I would end up at.

And that is when I discovered that focus/input switching was now reliable again as well.

I mean, it ‘works’ technically, but it defeats - at least for me - the usefulness, as I’d like to have a way to quickly switch to the activity and last virtual desktop I had last left (most probably the window I want to ‘return’ to).

I’m actually testing this with Wayland and the behaviour seems even more weird as switching activity seems to trigger the ‘desktop switching animation’ if each activity is on different virtual desktops.

I’m not really sure what the rationale behind this behaviour was / is.

Ah, then you are using it slightly different than I am.

I don’t want to change virtual desktop when switching activity.

E.g. if I am on Desktop 3 in Activity A and I switch to Activity B then I still want to be on Desktop 3 regardless of which desktop I had been on when I was on Activity B last time.

It is the “remember where I have been” for each Activity.

Both behaviors used to be options in Plasma 5.
For early versions of Plasma 6 those of us who did not want this behavior could still get the other by removing a certain plugin.
This is no longer possible and we need to wait for the other behavior to be restored.

Ok thanks for the explanation, but for me “remember where I have been” would be also “switch to the last desktop” (and window) I left before switching ‘away’ from that activity.

Maybe this graphical representation at the end helps. In my case it happens that I’m working in Window on Activity 1 and Desktop 1 and then switch to Activity 2 and Desktop 2, then back etc. This is because I use Activities for wider ‘contexts’ and then virtual desktops to organise windows / programmes (including some multi-window ones) within those contexts.
I understand the use of these tools has a high degree of ‘personal taste’ and use. I could only add that for this reason the more certain ‘behaviours’ are user-selectable the better IMHO :slight_smile:

The “remember” feature (which breaks my workflow) should be exactly that.

At the very beginning there is no desktop/activity association but when you switch from A1/D1 to A2 it remembers that you had D1 on A1.

You then switch to D2 on A2 and continue working there.
When you switch back to A1 it remembers that you had left while on D1 and does not only switch to A1 but also to D1.

Same the other way around as it has remembered that you were on D2 when leaving A2.

I can understand that people prefer this and I am have no issues either if that is the default, however I’d really like to have the option of “no desktop auto switching”.

At some point I will have to look at the KWin code. Can’t be that hard to “not remember” or “not restore” :smiley:

1 Like

I also tested this with a wayland session and the core bug, i.e. the ‘old’ window maintaining focus is still there (see update to original bug).

In wayland there are two extra annoyances:

  • the virtual desktop switching ‘animation’ (‘fade desktop’ in my case) is triggered
  • if I click on what I think is the window in focus on the activity / desktop because focus is on the old one everything ‘jumps’ back to that activity/desktop/window

Also trying to re-switch to the previous activity sens to the same (and therefore ‘wrong’ virtual desktop)

Essentially with wayland this seems completely borked for the way I use it :frowning:

1 Like

Ah, that is an important new finding!

If it is also broken in kwin_wayland then this will hopefully give it more priority as it will have more people affected.

1 Like