Thank you Josselin! I have found a small issue with the patch itself that might affect others. In get_current_desktops(), if (desktops) should read if (!desktops).
Please see http://paste.debian.net/136484/ for short program demonstrating the difference. Jerad