1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Fix #264 fall back to age ordered list if stacked list does not work

This commit is contained in:
Dave Davenport 2015-11-10 23:52:52 +01:00
parent 971d6df471
commit 09ab44bf92
3 changed files with 15 additions and 5 deletions

View file

@ -34,6 +34,7 @@ int window_get_cardinal_prop ( Display *display, Window w, Atom atom, unsigned l
X ( _NET_NUMBER_OF_DESKTOPS ), \
X ( _NET_CURRENT_DESKTOP ), \
X ( _NET_ACTIVE_WINDOW ), \
X ( _NET_CLIENT_LIST ), \
X ( _NET_WM_NAME ), \
X ( _NET_WM_STATE ), \
X ( _NET_WM_STATE_SKIP_TASKBAR ), \

View file

@ -379,7 +379,7 @@ static char ** _window_mode_get_data ( unsigned int *length, Switcher *sw, unsig
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
// find window list
Atom type;
int nwins;
int nwins = 0;
Window wins[100];
int count = 0;
Window curr_win_id = 0;
@ -401,8 +401,17 @@ static char ** _window_mode_get_data ( unsigned int *length, Switcher *sw, unsig
current_desktop = 0;
}
if ( window_get_prop ( display, root, netatoms[_NET_CLIENT_LIST_STACKING], &type, &nwins, wins, 100 * sizeof ( Window ) )
&& type == XA_WINDOW ) {
unsigned int nw = 100 * sizeof ( Window );
// First try Stacking order.. If this fails.
if ( !( window_get_prop ( display, root, netatoms[_NET_CLIENT_LIST_STACKING], &type, &nwins, wins, nw )
&& type == XA_WINDOW ) ) {
// Try to get order by age.
if ( !( window_get_prop ( display, root, netatoms[_NET_CLIENT_LIST], &type, &nwins, wins, nw )
&& type == XA_WINDOW ) ) {
nwins = 0;
}
}
if ( nwins > 0 ) {
char pattern[50];
int i;
unsigned int classfield = 0;