Fix the unexpected selection-change bug.

Do not remove a row from the list if it is already in the correct position.
This commit is contained in:
Sadrul Habib Chowdhury
2010-02-23 14:43:04 -05:00
parent d9262fc589
commit bafc958a92

View File

@@ -434,9 +434,17 @@ WListUpdate(struct win *p, struct ListData *ldata)
else
rbefore = NULL;
/* For now, just remove the row containing 'p'. */
gl_Window_remove(ldata, p);
glist_add_row(ldata, p, rbefore);
/* For now, just remove the row containing 'p' if it is not already in the right place . */
row = gl_Window_findrow(ldata, p);
if (row)
{
if (row->prev != rbefore)
gl_Window_remove(ldata, p);
else
p = NULL; /* the window is in the correct place */
}
if (p)
glist_add_row(ldata, p, rbefore);
glist_display_all(ldata);
}