"This should work fine nowadays" (about vino, Compiz and wrong optimism)

I've been back from KDE (4.2!) to Gnome and with the mighty powers of Compiz my desktop is the envy of my Windows coworkers and still geeky functional. Well, somehow functional. For a while I wondered why I can't properly use VNC to remote-control my desktop from home. The connection works and I see the desktop but nothing seems to happen when I click or type. Now I figured out the desktop in the VNC client window is just not refreshed while my mouse and keyboard actions really do what they were supposed to on the VNC server. This is my sad tale of how I learned that a regression may mean driving the motorcycle to work in the middle of the night after cursing VNC. :)

After a little searching through the lazyweb I found out that it's a bug reported on Ubuntu already. Apparently Compiz doesn't use the XDAMAGE extension properly. Somehow when using the graphics adapter's magic 3D powers X11 loses control of what sections are changed - I'm not an X11 guru. At least the client doesn't know when to redraw areas of the screen that have changed. The suggested workarounds were pretty ridiculous. "Start another x11vnc session without compiz and connect to that." Very funny. I want to control my running desktop - not create a new one. So I switched off compiz at work and - voila - VNC works again. Some eye-candy and shortcuts are gone but remote controlling the desktop is far more important while im on call. But I quickly missed Compiz. The missing eye-candy wasn't that bad. But metacity's window placement algorithm sucks as badly as back in 2002. As if I can hear it whisper: "I have no idea where to put that stupid window. You tell me."

I researched a little further and somehow the bug is known to Gnome, too. And other users suffering from the problem are pointed to the VirtualGL page of Wikipedia. Apparently the problem was fixed for several people until a regression was reported where things failed again. Seems like the vino developers removed the piece of code that detected the use of 3D window managers as a 2008 christmas present. Their reason: "This should work fine nowadays." Hell, no, it doesn't!

Somehow I downgraded vino to version 2.24.1-3 and ran the vino server manually (/usr/lib/vino/vino-server --sm-disable) to see if it prints any error message. Indeed it does:

Composite detected, disabling XDamage extension.
This is a workaround while XDamage extension does not work correctly with 3d desktops.
Hopefully it will work at next vino release.

This time it worked well, too . I upgraded to the current version 2.28.0-1 (as in "unstable" by today) and suddenly my VNC connection had the same problems again. Aha! Let's try the Lenny version 2.22.2-1. Works, too.

This has taken me hours to debug. Finally I know I can report a bug against the vino package. I wonder how long it would have taken a mortal to figure that out. :( [Sorry to my sponsorees who's package sponsoring requests were delayed again due to this mess.]

Comments

Why not just use some form of

Why not just use some form of NX instead of VNC? I know it may be a personal preference however I find NX faster and more reliable than VNC.

It's not well advertised

It's not well advertised (well, it's in the Ubuntu bug you linked is marked a duplicate of), but set the gconf key /desktop/gnome/remote_access/disable_xdamage to true: https://bugzilla.gnome.org/show_bug.cgi?id=593982

Its things like this and

Its things like this and millions of other little nits with Compiz that has kept me on Metacity (except for the occasional toying around with some of Compiz's more ridiculous features).

I what Jason means by "Metacity+Xrender" is Metacity's compositing feature which can only be enabled via a gconf setting. (Poke around in Configuration Editor, you'll find it. ;) )

@Jason: Thanks for the

@Jason: Thanks for the comment. I haven't tried that yet (and can't find much information on it actually). And somehow I don't like the lack of smartness in metacity. For example its window placement algorithm gets me mad. :) I'm not entirely happy with Compiz either though (resource leaks, problems).

Compiz is dead to everyone

Compiz is dead to everyone that matters. If you want a stable compositing WM right now, use Metacity+Xrender compositor or Kwin. The future will bring GNOME Shell+Mutter with 3D acceleration (it's already working but not considered stable).