Select the target desktop in non-i3_mode

Fixes https://github.com/DaveDavenport/rofi/issues/28

This is merged from the original upstream at:
https://github.com/seanpringle/simpleswitcher/blob/master/simpleswitcher.c
(including the TODO)
This commit is contained in:
Daniel Hahler 2014-03-02 10:36:00 +01:00
parent ea8c9923d5
commit 1834e25ef3

View file

@ -1245,6 +1245,12 @@ SwitcherMode run_switcher_window ( char **input )
} else } else
#endif #endif
{ {
// Change to the desktop of the selected window/client.
// TODO: get rid of strtol
window_send_message(root, root, netatoms[_NET_CURRENT_DESKTOP], strtol(list[selected_line], NULL, 10)-1,
SubstructureNotifyMask | SubstructureRedirectMask, time);
XSync(display, False);
window_send_message( root, ids->array[selected_line], netatoms[_NET_ACTIVE_WINDOW], 2, // 2 = pager window_send_message( root, ids->array[selected_line], netatoms[_NET_ACTIVE_WINDOW], 2, // 2 = pager
SubstructureNotifyMask | SubstructureRedirectMask, time ); SubstructureNotifyMask | SubstructureRedirectMask, time );
} }