use wnck_screen_get_active_window () to get active window