Flicker-free compositor replaces

If you develop compiz or write compiz plugins or just like to mess around with compiz settings, you’ll have probably gotten used to doing compiz –replace ccp over and over again. It’s not really all that harmful, but there that ugly flashing of everything that goes on as all the windows are unreparented, reparented, unredirected and redirected. This doesn’t just happen in cases where you are restarting your window manager, it also happens on login and logout too.

It’s 2011, there’s no reason why we should have to put up with this anymore, especially if today’s hardware and hardware from 6 years ago is more than capable of always compositing. The question is how to handle the movements between compositors. It doesn’t make any sense to use compiz for lightdm/gdm/kdm or when you are logging out. However it does make sense to use a lightweight compositor which can hold the image of your screen in place. With compositing happening all the way, it should be possible to have a way for each compositor to hand-off to each other such that the user never sees a flicker as windows are redirected and unredirected.

This is where the proposed _NET_CM_HANDOFF specification comes into place. It provides a very rudimentary protocol for compositors to handle management and unmanagement while ensuring that the user doesn’t see what’s going on, so all the user sees is a brief freeze of their screen as the new compositor takes over from the old one. For example:

In that example, the compositor is actually being completely restarted, but the old compositor stays around just long enough to ensure that the new compositor can take over from where it left off. This will be useful in the case of, eg, login, where lightdm can implement a simple compositor and compiz can take over from lightdm when it is ready to draw and smoothly fade-through or even have a cube-effect or something like that to signify that the login is done.

Just a nice touch for a day’s worth of hacking :)

edit: totally forgot about the code: https://code.launchpad.net/~smspillaz/+junk/handoff

About these ads

9 thoughts on “Flicker-free compositor replaces

      1. Small details like this one can make a huge difference on the user experience. This is something that Linux really needs.

        I hope Ubuntu 12.04 gets this.

    1. Yes, gnome-session can implement a simple wm/compositor of its own which will hold the last image on screen while it shuts down the window manager and do a simple fade-out to shutdown. It may even be that lightdm can take over gnome-session’s compositor too.

  1. When things get bad and I have no option but to run “unity –replace&”, all the opened windows are moved from all viewports to the first one at coordinates 0,0. I have tried the “Place Windows” plugin, but it’s rules are not respected in this situation. Since all opened windows are now at 0,0, they have their title bar covered by the global panel (additionally, their left sides are also covered by Unity launcher), they have to be moved by using left-alt method.
    I’ve been struggling to find a work around for that for a while. It seems llike the solution you described here in this post would fix it, right?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s