This code doens't work with Fedora 19 with GNOME 3.8.1. However I could use following command from within a shell in Emacs: {{{ wmctrl -r . . .