Bug 336467 - Animated window size changes can animate from an incorrect initial size
Summary: Animated window size changes can animate from an incorrect initial size
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR normal
Target Milestone: 5
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/125...
Keywords:
: 354993 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-19 18:02 UTC by Eike Hein
Modified: 2015-11-11 21:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.5
thomas.luebking: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Hein 2014-06-19 18:02:13 UTC
I use SMPlayer as my video player and frequently use a keyboard shortcut to switch it into fullscreen mode. When I do this while the SMPlayer window is maximized, the animated window size change effect (i.e. the texture scaling effect) often animates from or two the window's restored / non-maximized size, instead of from the maximized size. Or perhaps it shouldn't animate at all when the starting point or destination is fullscreen.

Reproducible: Always
Comment 1 Martin Flöser 2014-06-20 08:19:55 UTC
could it be that smplayer changes the state when going to fullscreen. Fullscreen is a special state and the window should still be maximized.
Comment 2 Eike Hein 2014-06-20 17:10:34 UTC
You might be right. I tried it with Dragon (KDE 4) right now, and this happens:

1. Open video, window is normal size ("restored")
2. Maximize by double-clicking title bar
3. Press fullscreen shortcut
4. Window animated to restore, then goes fullscreen (i.e. looks glitchy)
5. Press fullscreen shortcut again
6. Window returns to restored size, rather than previous maximized size

So I'm guessing Dragon actually unsets maximized before going fullscreen. SMPlayer returns to maximized correctly when returning from fullscreen, but with the mentioned glitchy animation transitions. But perhaps because it indeed screws up maximized state along the way.
Comment 3 Thomas Lübking 2014-06-20 18:14:21 UTC
SMplayer indeed unmaximizes before turning fullscreen - the reaction is the same on 4.11 and w/ BE::Animated (which animate every "significant™" geometry transition, but do so "chanined" ie. the window is fully unmaximized and then fully animated to fullscreen size)

Also compare w/ the behavior of setting smplayer fullscreen via the KWin Alt+F3 menu (rather than the integrated/mplayer shortcut "f")

I doubt that this could be reasonably "fixed" by KWin except by compressing/resorting state updates, ie. put a timer on the unmax request (and the fullscreen request) and then alter the dominant state (fullscreen) first and the unmaximization (which will not cause a geometry update since the window is still fullscreened) second when the state timer times out...
Comment 4 Eike Hein 2014-06-20 18:17:51 UTC
Let's close this then, considering it even returns to maximized state when un-fullscreening the restore is pointless and clearly an application bug - I don't think KWin needs to trouble itself with trying to mitigate it at that point.
Comment 5 Eike Hein 2014-06-20 18:23:43 UTC
Downstream ticket: https://sourceforge.net/p/smplayer/bugs/638/
Comment 6 Thomas Lübking 2015-11-07 21:03:15 UTC
*** Bug 354993 has been marked as a duplicate of this bug. ***
Comment 7 Thomas Lübking 2015-11-07 21:06:59 UTC
Clients ain't gonna fix it, so here's a workaround :)
Comment 8 Thomas Lübking 2015-11-11 21:36:11 UTC
Git commit c04f7919c1f751d00cf7ae3f52bfa6dfabdcb6e4 by Thomas Lübking.
Committed on 11/11/2015 at 21:18.
Pushed by luebking into branch 'master'.

abort max animation on unrelated geometry changes

stupid clients think it's relevant to withdraw other states
when going fullscreen, this means we trigger an
nmaximization animation and when that's done, the
window is fullscreen...

Unfortunately one of the stupid clients is QWidget and also
the window could get other, *legit*, resizes during the
animation, so we cancel it on occasion
FIXED-IN: 5.5
REVIEW: 125989

M  +13   -2    effects/maximize/package/contents/code/maximize.js

http://commits.kde.org/kwin/c04f7919c1f751d00cf7ae3f52bfa6dfabdcb6e4