diff options
-rw-r--r-- | src/list_window.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/list_window.c b/src/list_window.c index 05a42b7..2313cbf 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -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); } |