From: Michael D. Lowis Date: Wed, 30 Jul 2014 12:36:50 +0000 (-0400) Subject: Move and resize widnows when they are swapped. Not doing so causes ncurses to redraw... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=5f852b489c128de59ad449dee02ee3824656634b;p=archive%2Fafm.git Move and resize widnows when they are swapped. Not doing so causes ncurses to redraw improperly --- diff --git a/source/screen.c b/source/screen.c index 2e930fd..49cc656 100644 --- a/source/screen.c +++ b/source/screen.c @@ -176,13 +176,18 @@ void screen_swap_with_master(void){ //put master in list if(prev!=master) prev->next = master; master->next = focused->next; - //make focused new heaad + //make focused new head if(focused != tmp) focused->next = tmp; else focused->next = master; Frame_List->head = focused; //fix tail if put master at end if(master->next == NULL) Frame_List->tail = master; state_set_refresh_state(REFRESH_ALL_WINS); + // Resize and move os they don't overlap when we place them. + frame_resize((Frame_T*)focused->contents, 1, 1); + frame_move((Frame_T*)focused->contents, 0, 0); + frame_resize((Frame_T*)master->contents, 1, 1); + frame_move((Frame_T*)master->contents, 1, 1); } }