After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707248 - Add support for fullscreen and unfullscreen animations
Add support for fullscreen and unfullscreen animations
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 724758 (view as bug list)
Depends on:
Blocks: 641648
 
 
Reported: 2013-09-01 23:29 UTC by Cosimo Cecchi
Modified: 2015-10-17 22:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
compositor: add hooks for fullscreen and unfullscreen animations (16.86 KB, patch)
2013-09-01 23:29 UTC, Cosimo Cecchi
reviewed Details | Review
windowManager: add animations for fullscreen and unfullscreen (17.35 KB, patch)
2013-09-01 23:29 UTC, Cosimo Cecchi
reviewed Details | Review
compositor: add hooks for fullscreen and unfullscreen animations (16.70 KB, patch)
2014-07-29 13:22 UTC, Cosimo Cecchi
none Details | Review
windowManager: add animations for fullscreen and unfullscreen (17.10 KB, patch)
2014-07-29 13:24 UTC, Cosimo Cecchi
none Details | Review
windowManager: add animations for fullscreen and unfullscreen (8.99 KB, patch)
2015-10-12 19:42 UTC, Cosimo Cecchi
none Details | Review
compositor: add hooks for fullscreen and unfullscreen animations (6.53 KB, patch)
2015-10-12 19:42 UTC, Cosimo Cecchi
none Details | Review
compositor: add hooks for fullscreen and unfullscreen animations (3.94 KB, patch)
2015-10-13 02:53 UTC, Cosimo Cecchi
committed Details | Review
windowManager: add animations for fullscreen and unfullscreen (8.66 KB, patch)
2015-10-13 02:54 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2013-09-01 23:29:08 UTC
This is a first implementation for compositor animations when a window is made fullscreen or exits fullscreen.
Comments on my approach would be great.
Comment 1 Cosimo Cecchi 2013-09-01 23:29:10 UTC
Created attachment 253789 [details] [review]
compositor: add hooks for fullscreen and unfullscreen animations
Comment 2 Cosimo Cecchi 2013-09-01 23:29:41 UTC
Created attachment 253790 [details] [review]
windowManager: add animations for fullscreen and unfullscreen

We use the newly introduced feature from Mutter to hook up our own
fullscreen and unfullscreen animations.
To give the illusion of a transition as smooth as possible, we create a
snapshot of the current contents of the actor before its state is
changed, and crossfade between the two states while the size changes.

--

This is the shell part.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-09-02 01:04:44 UTC
Review of attachment 253790 [details] [review]:

I think this would have a race condition if the app chooses to fullscreen on its own, as it could have prepared a redraw, after which we'd be too late to respond. But we may not care about this in practice.

I'd also like to see if we can use the GPU to render the snapshot instead of using the CPU and cairo, but it might be sufficiently complicated, and this is a one-time cost, so I'm fine with landing this without it.

::: js/ui/windowManager.js
@@ +740,3 @@
+        let actorContent = Shell.util_get_content_for_window_actor(actor, oldRect);
+        let actorClone = new St.Widget({ content: actorContent });
+        actorClone.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);

What's the purpose of setting it to paint to an FBO?

@@ +745,3 @@
+        Main.uiGroup.add_actor(actorClone);
+
+        actor.__fullscreenClone = actorClone;

Instead of doing this, can't you simply add it to the onCompleteParams?

@@ +766,3 @@
+        actor.translation_y = actor.y;
+        actor.scaleX = 1 / scaleX;
+        actor.scaleY = 1 / scaleY;

Huh, does this work instead of using scale_x / scale_y?

@@ +777,3 @@
+                         });
+
+        shellwm.completed_fullscreen(actor);

This needs to be in fullscreenWindowDone.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-09-02 01:07:04 UTC
Review of attachment 253789 [details] [review]:

::: src/core/window.c
@@ +4117,3 @@
+      meta_screen_get_monitor_geometry (window->screen,
+                                        window->monitor->number,
+                                        &new_rect);

Hm, I thought fullscreen windows could span multiple monitors with _NET_WM_FULLSCREEN_MONITORS? I'd double-check with the code in constraints.c
Comment 5 Christian Hergert 2013-09-04 01:19:24 UTC
> Hm, I thought fullscreen windows could span multiple monitors with
> _NET_WM_FULLSCREEN_MONITORS? I'd double-check with the code in constraints.c

Yes they can. In fact, most Linux VMware products do this to support virtual machines across multiple monitors.

I would suggest avoiding transition in those cases.
Comment 6 drago01 2013-09-04 19:55:41 UTC
Review of attachment 253790 [details] [review]:

I don't really like the "read back and do in software" thing either but that aside ... does this work for unredirected windows? (which is very likely to happen for fullscreen windows).
You have to do all this *after* the window gets redirected (which happens when it gets unfullscreened didn't check on which exact point though).
Comment 7 Cosimo Cecchi 2014-07-29 13:22:14 UTC
Created attachment 281950 [details] [review]
compositor: add hooks for fullscreen and unfullscreen animations

Rebased to git master.
Comment 8 Cosimo Cecchi 2014-07-29 13:24:47 UTC
Created attachment 281951 [details] [review]
windowManager: add animations for fullscreen and unfullscreen

Updated and rebased to git master
Comment 9 Giovanni Campagna 2014-07-31 14:59:28 UTC
Review of attachment 281950 [details] [review]:

Barring any big design change in the way we do window animations, there is not much to review here.
Comment 10 Giovanni Campagna 2014-07-31 15:05:27 UTC
Review of attachment 281951 [details] [review]:

Mh... XComposite (as implemented in Xorg for the free drivers) creates a new pixmap any time the window changes size, so we can keep using the old one until we NameWindowPixmap, which we don't do until the actor is thawed at the end of animation, so why do we need this?
Comment 11 Rui Matos 2014-09-05 11:54:35 UTC
*** Bug 724758 has been marked as a duplicate of this bug. ***
Comment 13 Bastien Nocera 2015-07-01 22:00:38 UTC
(In reply to Cosimo Cecchi from comment #12)
> I pushed rebased patches here:
> https://git.gnome.org/browse/mutter/log/?h=wip/fullscreen
> https://git.gnome.org/browse/gnome-shell/log/?h=wip/fullscreen

Not asking for this to be done right now, but do you think it would be enhanced so that the client tells you which part of the window to zoom in to?
Comment 14 Cosimo Cecchi 2015-07-01 22:08:54 UTC
(In reply to Bastien Nocera from comment #13)
> Not asking for this to be done right now, but do you think it would be
> enhanced so that the client tells you which part of the window to zoom in to?

Yeah - that would be a combination of https://bugzilla.gnome.org/show_bug.cgi?id=747578 and https://bugzilla.gnome.org/show_bug.cgi?id=641648 which could be implemented on top of this.
Comment 15 Cosimo Cecchi 2015-10-12 19:42:30 UTC
Created attachment 313142 [details] [review]
windowManager: add animations for fullscreen and unfullscreen

--

Updated to use the new size change framework in mutter.
Comment 16 Cosimo Cecchi 2015-10-12 19:42:48 UTC
Created attachment 313143 [details] [review]
compositor: add hooks for fullscreen and unfullscreen animations

--

Updated for the new size change framework.
Comment 17 Jasper St. Pierre (not reading bugmail) 2015-10-12 20:01:52 UTC
Review of attachment 313143 [details] [review]:

::: src/meta/compositor.h
@@ +59,3 @@
   META_SIZE_CHANGE_UNMAXIMIZE,
+  META_SIZE_CHANGE_FULLSCREEN,
+  META_SIZE_CHANGE_UNFULLSCREEN

missing comma

::: src/x11/window-x11.c
@@ +2044,3 @@
       meta_window_move_resize_internal (window, flags, gravity, rect);
+
+      if (legacy_fullscreen)

Should legacy fullscreen windows get animations? That doesn't seem right to me.
Comment 18 Jasper St. Pierre (not reading bugmail) 2015-10-12 20:03:21 UTC
Review of attachment 313142 [details] [review]:

::: js/ui/windowManager.js
@@ +1275,3 @@
+                         });
+
+        shellwm.completed_size_change(actor);

So, part of the reason it's not working like how you want it to is because of this -- you're completing the size change immediately instead of letting it freeze.
Comment 19 Cosimo Cecchi 2015-10-13 02:53:31 UTC
Created attachment 313162 [details] [review]
compositor: add hooks for fullscreen and unfullscreen animations
Comment 20 Cosimo Cecchi 2015-10-13 02:54:48 UTC
Created attachment 313163 [details] [review]
windowManager: add animations for fullscreen and unfullscreen

--

The part where I don't let it freeze is intentional; I added some comments to the code to explain the logic, fixed a couple of bugs and refactored the animations in a single function now.
Comment 21 Jasper St. Pierre (not reading bugmail) 2015-10-13 03:30:17 UTC
Review of attachment 313162 [details] [review]:

Looks good to me.
Comment 22 Jasper St. Pierre (not reading bugmail) 2015-10-13 03:31:11 UTC
Review of attachment 313163 [details] [review]:

Not entirely happy with the code, but fine by me.
Comment 23 Cosimo Cecchi 2015-10-14 16:10:32 UTC
Comment on attachment 313162 [details] [review]
compositor: add hooks for fullscreen and unfullscreen animations

Attachment 313162 [details] pushed as a692fd3 - compositor: add hooks for fullscreen and unfullscreen animations
Comment 24 Cosimo Cecchi 2015-10-14 16:11:13 UTC
Attachment 313163 [details] pushed as 207c847 - windowManager: add animations for fullscreen and unfullscreen
Comment 25 Britt Yazel 2015-10-16 05:20:48 UTC
Hey, I love the animations, but I would like to add a note that the fullscreen animations look really weird on the 2nd screen of a dual screen setup. Whenever I fullscreen a youtube video the effect awkwardly slides in from the right, and when I un-fullscreen it the effect slides all the way across the primary monitor before settling on the 2nd monitor.

However, on the primary monitor the effects look great.
Comment 26 Florian Müllner 2015-10-16 13:54:12 UTC
(In reply to Britt Yazel from comment #25)
> Hey, I love the animations, but I would like to add a note that the
> fullscreen animations look really weird on the 2nd screen of a dual screen
> setup.

Fixed in bug 756697.
Comment 27 Britt Yazel 2015-10-16 15:52:17 UTC
Great! You rock
Comment 28 Britt Yazel 2015-10-17 22:20:09 UTC
Another quick comment, I see when pressing a fullscreen button from a youtube video with a web browser or by pressing f11 on a window we get the nice maximize and minimize effect, but neither double clicking a window border nor right clicking the border and saying maximize elicits an effect. Is this by design?
Comment 29 drago01 2015-10-17 22:22:40 UTC
(In reply to Britt Yazel from comment #28)
> Another quick comment, I see when pressing a fullscreen button from a
> youtube video with a web browser or by pressing f11 on a window we get the
> nice maximize and minimize effect, but neither double clicking a window
> border nor right clicking the border and saying maximize elicits an effect.
> Is this by design?

Yes this is about transitions to fullscreen not about maximize. The former is when an application covers the entire screen ... the latter just resizes the window to fit the workarea and leaves the panel and window decorations (if any) visible.
Comment 30 Britt Yazel 2015-10-17 22:59:51 UTC
Ahh I see, I guess I did not think of those as two different sets of actions, rather two varieties of the same action