mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.0923: second SIGWINCH signal may be ignored
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)
This commit is contained in:
59
src/term.c
59
src/term.c
@@ -3439,28 +3439,9 @@ shell_resized_check(void)
|
|||||||
* If 'mustset' is FALSE, we may try to get the real window size and if
|
* If 'mustset' is FALSE, we may try to get the real window size and if
|
||||||
* it fails use 'width' and 'height'.
|
* it fails use 'width' and 'height'.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
set_shellsize(int width, int height, int mustset)
|
set_shellsize_inner(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)
|
if (updating_screen)
|
||||||
// resizing while in update_screen() may cause a crash
|
// resizing while in update_screen() may cause a crash
|
||||||
return;
|
return;
|
||||||
@@ -3472,8 +3453,6 @@ set_shellsize(int width, int height, int mustset)
|
|||||||
if (curwin->w_buffer == NULL || curwin->w_lines == NULL)
|
if (curwin->w_buffer == NULL || curwin->w_lines == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
++busy;
|
|
||||||
|
|
||||||
#ifdef AMIGA
|
#ifdef AMIGA
|
||||||
out_flush(); // must do this before mch_get_shellsize() for
|
out_flush(); // must do this before mch_get_shellsize() for
|
||||||
// some obscure reason
|
// some obscure reason
|
||||||
@@ -3547,7 +3526,39 @@ set_shellsize(int width, int height, int mustset)
|
|||||||
cursor_on(); // redrawing may have switched it off
|
cursor_on(); // redrawing may have switched it off
|
||||||
}
|
}
|
||||||
out_flush();
|
out_flush();
|
||||||
--busy;
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
923,
|
||||||
/**/
|
/**/
|
||||||
922,
|
922,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user