mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Define winch_flag as volatile sig_atomic_t.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
6cbe12d968
commit
1463d550b0
@ -101,7 +101,7 @@ mc_global_t mc_global = {
|
||||
.ugly_line_drawing = FALSE,
|
||||
.old_mouse = FALSE,
|
||||
.alternate_plus_minus = FALSE,
|
||||
.winch_flag = FALSE
|
||||
.winch_flag = 0
|
||||
},
|
||||
|
||||
.vfs =
|
||||
|
@ -21,6 +21,9 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
/* for sig_atomic_t */
|
||||
#include <signal.h>
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
/* The O_BINARY definition was taken from gettext */
|
||||
@ -258,7 +261,7 @@ typedef struct
|
||||
gboolean alternate_plus_minus;
|
||||
|
||||
/* Set if the window has changed it's size */
|
||||
gboolean winch_flag;
|
||||
volatile sig_atomic_t winch_flag;
|
||||
} tty;
|
||||
|
||||
struct
|
||||
|
@ -2106,7 +2106,7 @@ tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block)
|
||||
}
|
||||
}
|
||||
|
||||
if (!block || mc_global.tty.winch_flag)
|
||||
if (!block || mc_global.tty.winch_flag != 0)
|
||||
{
|
||||
time_addr = &time_out;
|
||||
time_out.tv_sec = 0;
|
||||
@ -2126,7 +2126,7 @@ tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block)
|
||||
{
|
||||
if (redo_event)
|
||||
return EV_MOUSE;
|
||||
if (!block || mc_global.tty.winch_flag)
|
||||
if (!block || mc_global.tty.winch_flag != 0)
|
||||
return EV_NONE;
|
||||
vfs_timeout_handler ();
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ sigwinch_handler (int dummy)
|
||||
{
|
||||
(void) dummy;
|
||||
|
||||
mc_global.tty.winch_flag = TRUE;
|
||||
mc_global.tty.winch_flag = 1;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -154,7 +154,7 @@ sigwinch_handler (int dummy)
|
||||
(void) dummy;
|
||||
|
||||
tty_change_screen_size ();
|
||||
mc_global.tty.winch_flag = TRUE;
|
||||
mc_global.tty.winch_flag = 1;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -358,7 +358,7 @@ mc_refresh (void)
|
||||
if (mc_global.we_are_background)
|
||||
return;
|
||||
#endif /* ENABLE_BACKGROUND */
|
||||
if (!mc_global.tty.winch_flag)
|
||||
if (mc_global.tty.winch_flag == 0)
|
||||
tty_refresh ();
|
||||
else
|
||||
{
|
||||
@ -373,7 +373,7 @@ mc_refresh (void)
|
||||
void
|
||||
dialog_change_screen_size (void)
|
||||
{
|
||||
mc_global.tty.winch_flag = FALSE;
|
||||
mc_global.tty.winch_flag = 0;
|
||||
#if defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4
|
||||
#if defined TIOCGWINSZ
|
||||
|
||||
|
@ -532,7 +532,7 @@ frontend_run_dlg (Dlg_head * h)
|
||||
|
||||
while (h->state == DLG_ACTIVE)
|
||||
{
|
||||
if (mc_global.tty.winch_flag)
|
||||
if (mc_global.tty.winch_flag != 0)
|
||||
dialog_change_screen_size ();
|
||||
|
||||
if (is_idle ())
|
||||
|
Loading…
Reference in New Issue
Block a user