Bug 301447 - Desktop grid effect changes activities
Summary: Desktop grid effect changes activities
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: activities (show other bugs)
Version: 4.8.80
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Vlad Zahorodnii
URL: http://youtu.be/WisvuJ2Ts_w
Keywords:
: 410899 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-08 14:02 UTC by Sebastian Kuźlak
Modified: 2019-08-27 05:26 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.13.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Kuźlak 2012-06-08 14:02:10 UTC
Lets assume we have 2 activities(for good results lets assume we have maximized apps).
We start an app on activity 1 and place it on virtula desktop 2.
Then we go to activity 2, start and other app and place it on desktop 3. 
Lets say we want to go to virtual desktop 2 so we activate desktop grid and click on a 2nd desktop. This results in changing the virtual deskop 3 to 2 and activity 2 to activity 1 instead of changing the desktop 3 to desktop 2 on activity 2. 

Desktop grid does not render windows from other activities but still it responds to the positions of the windows on other activities.

If my explanation is confusing ther is a link attached to URL that describes it nicely.



Reproducible: Always

Steps to Reproduce:
1.start app ie konsole on desktop 2 activity 1
2.go to desktop 3.
3.then change activity 1 to activty 2.
4.start app ie dolphin on desktop 3 activty 2.
5.run desktop grid effect ( on desktop 3 there should be a dolphin )
6. click desktop 2 - empty desktop ( now we get moved to activity 1 and konsole is active )
7. run desktop grid effect ( on desktop 2 there should be konsole )
8. click desktop 3- empty desktop ( ( now we get moved to activity 2 and dolphin is active )


Expected Results:  
grid effect should not change activities. only desktops.
Comment 1 Thomas Lübking 2012-06-09 21:05:22 UTC
could be related to bug #301239 - at least i can't reproduce it atm.
Comment 2 Sebastian Kuźlak 2012-06-13 14:32:39 UTC
Im sorry it looks like it might be my mistake. Ive deleted ~/.kde4 dir and i cannot reproduce it any more. Sorry for the confusion.
Comment 3 Gavin Cooper 2012-10-19 21:59:28 UTC
I experience exactly this bug and have been able to reproduce it every time since version 4.8 on Debian. It's the same with version 4.9.2 on Arch.

The reason it sometimes can't be reproduced is because Desktop Grid has an option called "Use Present Windows effect to layout the windows" which obscures this bug and is also the default. You can see that this option is disabled in Thomas's video that he linked. When he started with a fresh ~/.kde4 directory, he probably kept the default.

I believe the solution will look similar to bug #242555 and this commit:

http://commits.kde.org/kde-workspace/e9410ba51e4674819fc8c37c8f122f1233a8c78a
Comment 4 Gavin Cooper 2012-10-19 22:27:14 UTC
Another activities-related inconsistency I just discovered is related to this one. If, in Activity A, you use Desktop Grid to drag and rearrange the desktops, the same desktops are also rearranged in Activity B. This may technically be a separate bug, but it illustrates that there is a mix of Activities-aware and Activities-unaware code that limits the adoption of Activities in general.
Comment 5 Thomas Lübking 2012-10-23 20:09:43 UTC
Bug reproducible. Please refile the different bug if it still exists after this one was fixed.
The reason why this happens is that the activity code was stuffed onto the existing during a more or less unmentored GSoC.
Comment 6 Stefanos Harhalakis 2013-06-03 13:13:49 UTC
FYI: This is still present in 4.10.2.

It's funny because you can have an empty activity, start the desktop-grid, click somewhere and you end up switching back to another activity. Takes some effort to to understand what you just happened, especially if you use the same background in the two activities.

It also gets really confusing when you try to drag a whole desktop (in desktop grid mode) and you end up dragging an invisible window (from another activity) instead.

Unfortunately it kind of renders the grid effect useless when you have multiple activities.
Comment 7 Stefanos Harhalakis 2013-06-04 14:50:12 UTC
Is this a fix?

https://git.reviewboard.kde.org/r/110824/

If yes can you include it?
Comment 8 Sebastian Kuźlak 2016-01-09 13:45:03 UTC
this is still present in 5.5
Comment 9 Diego Gangl 2017-09-22 00:00:45 UTC
This bug still happens in 5.10.5 and is annoying as hell. Enabling "Use present windows" seems to make it work.
Comment 10 Marcin Migacz 2018-07-11 12:14:07 UTC
This bug is annoying as hell i agree ! Please fix it. Or at least tell me how i can fix it. Option "using present window" is showing windows organised in desktop. But i want to see them how they are organised by myself. As they are! 
And fix probably is a few line of code.
Comment 11 Vlad Zahorodnii 2018-07-11 14:06:41 UTC
Git commit 0c3047a8f1d4a70f39250c759224a7dfab72a76b by Vlad Zagorodniy.
Committed on 11/07/2018 at 13:39.
Pushed by vladz into branch 'Plasma/5.13'.

[effects/desktopgrid] Don't change activities

Summary:
If the Desktop Grid effect doesn't use the Present Windows effect to
layout windows, windowAt helper can return a window that doesn't belong
to current activity because it doesn't check whether that window belongs
to current activity.

This change addresses that problem by adding corresponding check.
FIXED-IN: 5.13.4

Test Plan:
//Unchecked "Use Present Windows effect to layout the windows".//

* Switched to activity #1
* Switched to virtual desktop #1
* Launched Konsole and maximized it(to increate hit area)
* Switched to activity #2
* Switched to virtual desktop #2
* Launched Dolphin and maximized it
* Activated the Desktop Grid effect, clicked on virtual desktop #1 (activity #2 is still active)
* Switched to activity #1
* Activated the Desktop Grid effect, clicked on virtual desktop #2 (activity #1 is still active)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14046

M  +1    -1    effects/desktopgrid/desktopgrid.cpp

https://commits.kde.org/kwin/0c3047a8f1d4a70f39250c759224a7dfab72a76b
Comment 12 Marcin Migacz 2018-07-11 17:21:19 UTC
You found it ! That is fantastic :D After living with that bug more than a year is a great information ! :D

Can you tell me how i can apply this changes ? 
I'm on manjaro.
Comment 13 Stefanos Harhalakis 2018-07-11 22:40:02 UTC
Thanks Vlad!
Comment 14 Diego Gangl 2018-07-12 11:36:58 UTC
Thanks Vlad, and thanks Marcin for bringing this back to life!
Comment 15 Vlad Zahorodnii 2019-08-27 05:24:47 UTC
Git commit e918cb5d2d3de033635d0cd7463de25fd6312b24 by Vlad Zagorodniy.
Committed on 27/08/2019 at 05:22.
Pushed by vladz into branch 'Plasma/5.12'.

[effects/desktopgrid] Don't change activities

Summary:
If the Desktop Grid effect doesn't use the Present Windows effect to
layout windows, windowAt helper can return a window that doesn't belong
to current activity because it doesn't check whether that window belongs
to current activity.

This change addresses that problem by adding corresponding check.
FIXED-IN: 5.13.4

Test Plan:
//Unchecked "Use Present Windows effect to layout the windows".//

* Switched to activity #1
* Switched to virtual desktop #1
* Launched Konsole and maximized it(to increate hit area)
* Switched to activity #2
* Switched to virtual desktop #2
* Launched Dolphin and maximized it
* Activated the Desktop Grid effect, clicked on virtual desktop #1 (activity #2 is still active)
* Switched to activity #1
* Activated the Desktop Grid effect, clicked on virtual desktop #2 (activity #1 is still active)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14046

M  +1    -1    effects/desktopgrid/desktopgrid.cpp

https://commits.kde.org/kwin/e918cb5d2d3de033635d0cd7463de25fd6312b24
Comment 16 Vlad Zahorodnii 2019-08-27 05:26:32 UTC
*** Bug 410899 has been marked as a duplicate of this bug. ***