This effect animates transition to/from fullscreen mode. For the
most part it is a copy-paste of the Maximize effect with some editing.
Details
Diff Detail
- Repository
- R108 KWin
- Branch
- arcpatch-D9391
- Lint
No Linters Available - Unit
No Unit Test Coverage
Thanks for your patch! I did a similar patch a while ago but I didn't submit it as it seems to cause visual glitches with various apps, such as when fullscreening Yakuake or Chrome.
I guess you should see glitches when maximizing windows too. For example, when I maximize Firefox with reddit, sidebar flicks, etc. So, I guess, that's a side effect of maximize effect.
It seems to be working, but there is a problem with GTK apps. They have wrong positions in their geometries:
Output like "{...} -> {...}" comes from geometryChanged:
js geometryChanged: function (window, oldGeometry) { "use strict"; print(JSON.stringify(oldGeometry), "->", JSON.stringify(window.geometry)); if (window.fullScreenAnimation) {
Output like "oldGeometry = ..." comes from fullScreenChanged:
js fullScreenChanged: function (window) { "use strict"; if (!window.oldGeometry) { return; } var oldGeometry = window.oldGeometry, newGeometry = window.geometry; if (oldGeometry.width == newGeometry.width && oldGeometry.height == newGeometry.height) oldGeometry = window.olderGeometry; window.olderGeometry = window.oldGeometry; window.oldGeometry = newGeometry; print("oldGeometry=", JSON.stringify(oldGeometry)); print("newGeometry=", JSON.stringify(newGeometry)); print("contentsRect=", JSON.stringify(window.contentsRect)); print("decorationInnerRect=", JSON.stringify(window.decorationInnerRect)); window.fullScreenAnimation = animate({
Konsole(Qt): Entering Fullscreen mode
kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":55,\"y\":0,\"width\":1000,\"height\":583} -> {\"x\":59,\"y\":29,\"width\":992,\"height\":550}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "oldGeometry= {\"x\":59,\"y\":29,\"width\":992,\"height\":550}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "newGeometry= {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "contentsRect= {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "decorationInnerRect= {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":0,\"y\":0,\"width\":1366,\"height\":768} -> {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":55,\"y\":0,\"width\":1000,\"height\":583} -> {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}"
everything is fine!
Konsole(Qt): Leaving Fullscreen mode
kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":0,\"y\":0,\"width\":1366,\"height\":768} -> {\"x\":-4,\"y\":-29,\"width\":1374,\"height\":801}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "oldGeometry= {\"x\":-4,\"y\":-29,\"width\":1374,\"height\":801}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "newGeometry= {\"x\":55,\"y\":0,\"width\":1000,\"height\":583}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "contentsRect= {\"x\":4,\"y\":29,\"width\":992,\"height\":550}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "decorationInnerRect= {\"x\":4,\"y\":29,\"width\":992,\"height\":550}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":55,\"y\":0,\"width\":1000,\"height\":583} -> {\"x\":55,\"y\":0,\"width\":1000,\"height\":583}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":0,\"y\":0,\"width\":1366,\"height\":768} -> {\"x\":55,\"y\":0,\"width\":1000,\"height\":583}"
everything is fine!
Gimp(gtk): Entering Fullscreen mode
kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":87,\"y\":0,\"width\":1141,\"height\":593} -> {\"x\":87,\"y\":0,\"width\":1133,\"height\":560}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "oldGeometry= {\"x\":87,\"y\":0,\"width\":1133,\"height\":560}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "newGeometry= {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "contentsRect= {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "decorationInnerRect= {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":0,\"y\":0,\"width\":1366,\"height\":768} -> {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":87,\"y\":0,\"width\":1141,\"height\":593} -> {\"x\":0,\"y\":0,\"width\":1366,\"height\":768}"
should be
kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "oldGeometry= {\"x\":87,\"y\":29,\"width\":1133,\"height\":560}"
Gimp(gtk): Leaving Fullscreen mode
kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":0,\"y\":0,\"width\":1366,\"height\":768} -> {\"x\":0,\"y\":0,\"width\":1374,\"height\":801}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "oldGeometry= {\"x\":0,\"y\":0,\"width\":1374,\"height\":801}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "newGeometry= {\"x\":87,\"y\":0,\"width\":1141,\"height\":593}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "contentsRect= {\"x\":4,\"y\":29,\"width\":1133,\"height\":560}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "decorationInnerRect= {\"x\":4,\"y\":29,\"width\":1133,\"height\":560}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":87,\"y\":0,\"width\":1141,\"height\":593} -> {\"x\":87,\"y\":0,\"width\":1141,\"height\":593}" kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "{\"x\":0,\"y\":0,\"width\":1366,\"height\":768} -> {\"x\":87,\"y\":0,\"width\":1141,\"height\":593}"
should be:
kwin_scripting: "/home/dev/kde/usr/share/kwin/effects/kwin4_effect_fullscreen/contents/code/fullscreen.js" : "oldGeometry= {\"x\":-4,\"y\":-29,\"width\":1374,\"height\":801}"
I guess the only option is to force StaticGravity when entering full screen mode.
[effects] Add 'Fullscreen' effect
This effect animates transition to/from fullscreen mode. For the
most part it is a copy-paste of the Maximize effect with some editing.
D6799 for the record (I like your patch better, actually, just if you want to look at my implementation)
A possibility to solve this problem with gtk would be to restrict to Wayland windows. I'm absolutely against any changed to window gravity on X11. And I'm also not happy with a new animation if we already know that it doesn't work correctly. Given that 5.12 will be an LTS this might be unpleasant. I remember that it took several iterations and bugfixes to get the maximize effect work properly.
Due to that I personally would prefer if we don't add this for 5.12 or only for Wayland windows.
As this adds a new effect: all the effectloader autotests need to be adjusted, otherweise the tests will start to fail.
Updating D9391: [effects] Add 'Fullscreen' effect
Add fullscreen effect to the effect loader tests.
I don't like changing window gravity code either.
Given that 5.12 will be an LTS this might be unpleasant.
Yeah, it should be at least 5.13
Due to that I personally would prefer if we don't add this for 5.12 or only for Wayland windows.
Is it okay to support only Wayland?
Could you please post a new video with a before and after? I would like to preview it.
Due to that I personally would prefer if we don't add this for 5.12 or only for Wayland windows.
Is it okay to support only Wayland?
Personally I would prefer to have the code generic. But we also see in the maximize effect that there are differences between X11 and Wayland which don't allow to have a generic effect (see bug 384462). So from a maintenance and forward compatibility point of view it makes sense to restrict to Wayland if we are aware that X11 is tricky.
So, I've tested this effect on Wayland..
Konsole(XWayland, Qt)
Seems, like cross fading doesn't work.
Konsole(natively on Wayland, Qt)
- Maximize effect doesn't work (bug 384462?)
- Konsole doesn't enter fullscreen mode
Firefox(XWayland, gtk)
Still, there are problems with FF.
GNOME Terminal(XWayland, gtk)
GNOME Terminal(Wayland, gtk)
Also, this effect is really buggy. Just keep pressing F11:
That's a really bad idea to cancel currently running animation and start a new one. It would be better to toggle direction of a timeline, but seems like there is no way to do this with js api.
Updating D9391: [effects] Add 'Fullscreen' effect
I think this should be rewritten in C++ for several reasons:
- we need to control timeline
- when entering or leaving fullscreen mode, we should handle docks in a special way and I don't really think it is possible with js api
Also, please notice that signature of windowFullScreenChanged has changed.
Now, it also includes previous geometry of a window. This plus several changes
in geometry.cpp and shell_client.cpp should result in a generic
fullscreen effect, I hope.
PLEASE NOTICE THAT'S JUST A STUB, IT DOES NOTHING! (I'm intrested in feedback)
Also, seems like Qt have a bug. If you enter/leave fullscreen mode in any
Qt app, ShellClient::setFullScreen is not called.
Updating D9391: [effects] Add 'Fullscreen' effect
Re-implemented this effect. The only missing part is emitters of windowFullScreenChanged
signal.
X11
Xwayland
Problems
Seems like KWin has a bug. When a window enters/leaves fullscreen mode, there is a moment when the window is smaller than original(or some sort of it):
With 'Fullscreen' effect turned on
With 'Fullscreen' effect turned off
Updating D9391: [effects] Add 'Fullscreen' effect
- Emit windowFullScreenChanged signal
- Unreference previous pixmap when a window is deleted