To: vim_dev@googlegroups.com Subject: Patch 9.0.0923 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0923 Problem: Second SIGWINCH signal may be ignored. Solution: When set_shellsize() is busy when called then run the inner code again when it's done. (issue #424) Files: src/term.c *** ../vim-9.0.0922/src/term.c 2022-11-22 12:58:22.754664254 +0000 --- src/term.c 2022-11-22 20:37:26.365583307 +0000 *************** *** 3439,3466 **** * If 'mustset' is FALSE, we may try to get the real window size and if * it fails use 'width' and 'height'. */ ! void ! set_shellsize(int width, int height, int mustset) { - static int busy = FALSE; - - /* - * Avoid recursiveness, can happen when setting the window size causes - * another window-changed signal. - */ - if (busy) - return; - - if (width < 0 || height < 0) // just checking... - return; - - if (State == MODE_HITRETURN || State == MODE_SETWSIZE) - { - // postpone the resizing - State = MODE_SETWSIZE; - return; - } - if (updating_screen) // resizing while in update_screen() may cause a crash return; --- 3439,3447 ---- * If 'mustset' is FALSE, we may try to get the real window size and if * it fails use 'width' and 'height'. */ ! static void ! set_shellsize_inner(int width, int height, int mustset) { if (updating_screen) // resizing while in update_screen() may cause a crash return; *************** *** 3472,3479 **** if (curwin->w_buffer == NULL || curwin->w_lines == NULL) return; - ++busy; - #ifdef AMIGA out_flush(); // must do this before mch_get_shellsize() for // some obscure reason --- 3453,3458 ---- *************** *** 3547,3553 **** cursor_on(); // redrawing may have switched it off } out_flush(); ! --busy; } /* --- 3526,3564 ---- cursor_on(); // redrawing may have switched it off } out_flush(); ! } ! ! void ! set_shellsize(int width, int height, int mustset) ! { ! static int busy = FALSE; ! static int do_run = FALSE; ! ! if (width < 0 || height < 0) // just checking... ! return; ! ! if (State == MODE_HITRETURN || State == MODE_SETWSIZE) ! { ! // postpone the resizing ! State = MODE_SETWSIZE; ! return; ! } ! ! // Avoid recursiveness. This can happen when setting the window size ! // causes another window-changed signal or when two SIGWINCH signals come ! // very close together. There needs to be another run then after the ! // current one is done to pick up the latest size. ! do_run = TRUE; ! if (busy) ! return; ! ! while (do_run) ! { ! do_run = FALSE; ! busy = TRUE; ! set_shellsize_inner(width, height, mustset); ! busy = FALSE; ! } } /* *** ../vim-9.0.0922/src/version.c 2022-11-22 19:16:26.232887100 +0000 --- src/version.c 2022-11-22 20:31:42.876803876 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 923, /**/ -- Nobody will ever need more than 640 kB RAM. -- Bill Gates, 1983 Windows 98 requires 16 MB RAM. -- Bill Gates, 1999 Logical conclusion: Nobody will ever need Windows 98. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///