Bug 361121

Summary: Minimize animation (lamp) showing artifacts on left screen when taskbar is on left side of right screen
Product: [Plasma] kwin Reporter: Marcelo Bossoni <mmbossoni>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, vlad.zahorodnii, xgdgsc
Priority: NOR    
Version: 5.6.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.27.6
Sentry Crash Report:
Attachments: Note the artifacts on left screen
Support information
Xprop - App on right screen
Xprop - App on left screen
Xprop - Taskbar panel

Description Marcelo Bossoni 2016-03-28 23:01:22 UTC
During minimizing animation, when you have multi monitor with the taskbar on left side of the right screen, several animation artifacts can be seen on left screen.
Artifacts are seen minimizing the window on the right screen.
Minimizing the window on left screen renders completely wrong animation.

Reproducible: Always
Comment 1 Marcelo Bossoni 2016-03-28 23:04:28 UTC
Created attachment 98127 [details]
Note the artifacts on left screen
Comment 2 Thomas Lübking 2016-03-28 23:42:50 UTC
Please attach the output of "qdbus org.kde.KWin /KWin supportInformation"
Comment 3 Marcelo Bossoni 2016-03-29 00:02:27 UTC
Created attachment 98128 [details]
Support information
Comment 4 Thomas Lübking 2016-03-29 14:31:46 UTC
Thanks.
Does this also happen when minimizing the window via the titlebar button? (assuming you were using the taskbar)
Comment 5 Marcelo Bossoni 2016-03-29 22:12:42 UTC
Sorry for taking so long to reply.
I've tried with the button on titlebar and same issue occurs
Comment 6 Marcelo Bossoni 2016-03-29 22:23:50 UTC
Just made a video
Notice also that windows on right screen goes below taskbar
https://drive.google.com/open?id=0BzXlzIyJc44kQkxJN1pIYWZ6b2M
Comment 7 Marcelo Bossoni 2016-03-29 22:34:56 UTC
I think I provided the wrong link, sorry about that.
https://drive.google.com/file/d/0BzXlzIyJc44kQkxJN1pIYWZ6b2M/view?usp=sharing
Comment 8 Martin Flöser 2016-04-01 13:27:34 UTC
the video shows the task bar in the middle of the combined screens. We know that this is in general not properly supported (e.g. no struts on middle panel). Does the problem also happen if you put the panel to the right most screen edge?
Comment 9 Marcelo Bossoni 2016-04-01 13:56:38 UTC
Nope, it does not.
Comment 10 Martin Flöser 2016-04-01 14:47:59 UTC
good :-)

can I ask for one more thing: please move it back to the middle so that it's broken and then xprop a window.
Comment 11 Marcelo Bossoni 2016-04-02 02:58:15 UTC
Created attachment 98197 [details]
Xprop - App on right screen
Comment 12 Marcelo Bossoni 2016-04-02 02:58:37 UTC
Created attachment 98198 [details]
Xprop - App on left screen
Comment 13 Marcelo Bossoni 2016-04-02 02:59:08 UTC
Created attachment 98199 [details]
Xprop - Taskbar panel
Comment 14 Martin Flöser 2016-04-04 14:59:43 UTC
ok, from that output it looks like icon geometry is correct. That's sad, that means the bug is in KWin.
Comment 15 Thomas Lübking 2016-04-04 15:53:40 UTC
Sorry for your arm :-P

My guess is that the animation gets retargetted (seems to be quite required reg. the tooltips)
Not only is this the least tested feature, but I assume that altering the from to the current position drops the region between the last interpolated position and the interpolated position at the repaint.

The most simple solution should be to add a complete (full scene) layer repaint when an animation is retargetted.
If that works, one could seek into actually capturing the dropped geometry.
Comment 16 Thomas Lübking 2016-04-04 16:08:06 UTC
Scratch that, wrong bug - sorry.
Comment 17 Vlad Zahorodnii 2018-08-10 12:54:09 UTC
(In reply to Martin Flöser from comment #14)
> ok, from that output it looks like icon geometry is correct. That's sad,
> that means the bug is in KWin.

Yeah, that's a bug in the Magic lamp effect.

It doesn't take into account what screen minimized window belongs to. E.g. if the minimized window is on the left screen and panel is on the right screen, then the Magic lamp effect would assume that it should "squash"(?) the window to the left, which is wrong. 

Also, it looks like that's not the only bug. If panel is on the right edge of the left screen, then minimized window will be "shot" to the right edge of the right screen.
Comment 18 Vlad Zahorodnii 2018-08-10 12:55:44 UTC
s/is on the left screen and panel is on the right screen/is on the left screen and panel is on the left edge of the right screen/
Comment 19 Vlad Zahorodnii 2018-08-25 19:59:16 UTC
There are several problems:

* the Magic lamp effect can pick wrong direction for a window that belongs to screen other than to which belongs dock/panel;

* the Magic lamp doesn't clip transformed windows;

* if the window and its icon are overlapping, the animation will be messed up. We have to move the window away from its icon and then start animation. That's not enough to have one single animation.
Comment 20 Vlad Zahorodnii 2023-05-16 06:17:33 UTC
Git commit 00a1a506d18f99c16451af2fd5ee859c646b5b14 by Vlad Zahorodnii.
Committed on 16/05/2023 at 06:03.
Pushed by vladz into branch 'master'.

effects/magiclamp: Make it look good with floating panels

The magic lamp literally "squashes" the window through the window icon
in the task manager.

It's assumed that there's nothing below the panel, so the magic lamp
doesn't perform any clipping.

With floating panels, it's not the case. So let's clamp the x or the y
coordinates when the window moves horizontally or vertically,
respectively, in order to ensure that the window is not visible in the
gap between the floating panel and the screen edge.
Related: bug 466177

M  +68   -8    src/plugins/magiclamp/magiclamp.cpp

https://invent.kde.org/plasma/kwin/commit/00a1a506d18f99c16451af2fd5ee859c646b5b14
Comment 21 Vlad Zahorodnii 2023-05-16 07:12:17 UTC
Git commit e749d285feccc91111255155b2ee2d21cb00b205 by Vlad Zahorodnii.
Committed on 16/05/2023 at 06:25.
Pushed by vladz into branch 'Plasma/5.27'.

effects/magiclamp: Make it look good with floating panels

The magic lamp literally "squashes" the window through the window icon
in the task manager.

It's assumed that there's nothing below the panel, so the magic lamp
doesn't perform any clipping.

With floating panels, it's not the case. So let's clamp the x or the y
coordinates when the window moves horizontally or vertically,
respectively, in order to ensure that the window is not visible in the
gap between the floating panel and the screen edge.
Related: bug 466177
(cherry picked from commit 00a1a506d18f99c16451af2fd5ee859c646b5b14)

M  +68   -8    src/effects/magiclamp/magiclamp.cpp

https://invent.kde.org/plasma/kwin/commit/e749d285feccc91111255155b2ee2d21cb00b205