Monday, February 1, 2010

how to fix flash in Ubuntu Karmic

This has been annoying me for a while now. I wasn't able to hit half of the buttons in flash games, youtube, or GrooveShark while running karmic. I figured an update in flash broke my system but it turns out the problem runs a bit deeper.

Gnome decided to enable client side rendering in their GTK windows. This allows for quicker and cleaner redraws when doing special effects. I happen to run fluxbox so I didn't notice anything in the switch. Eclipse users might be familiar with this since Eclipse hasn't handled the change yet. I stole most of this fix from their boards.

You can disable this new client side rendering using the environment variable GDK_NATIVE_WINDOWS=1.

My trouble was that it was impossible to get that variable to set anywhere in my config. I edited .profile (which is frowned on), .bash_profile (which is cheating since the variable won't make it into the window manager), /etc/environment (which sets it on a system level), and ~/.pam_environment (which sets it at a user level). None of these solutions would actually get the environment variable to stick.

Flash forward a frustrating half an hour of trial and error and I realized I started up the gnome-settings-daemon in my fluxbox startup script. I put a sleep after the gnome-settings-daemon and appended the GDK_NATIVE_WINDOWS assignment and everything started working. Turns out gnome-settings-daemon was hiding the environment variable changes. I have no idea how to reconfigure the setting daemon so I'm currently letting the hack stand (1 second delay and all).

Long and short of it: Add the line "export GDK_NATIVE_WINDOWS=1" to your startup files (any that I mentioned above) and keep in mind the gnome-settings-daemon might decide to squash them.

Hopefully that will spare you some troubles

No comments: