Fix of terminal resize handling

...and fix of <sys/ioctl.h> includes
and includes cleanup in src/filemanager/layout.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2011-04-11 14:35:32 +04:00
parent 291abae262
commit 47115e97ad
3 changed files with 11 additions and 13 deletions

View File

@ -26,6 +26,13 @@
#include <config.h> #include <config.h>
/* If TIOCGWINSZ supported, make it available here, because window resizing code
* depends on it... */
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#include <termios.h>
#include "lib/global.h" #include "lib/global.h"
#include "lib/tty/tty.h" /* LINES, COLS */ #include "lib/tty/tty.h" /* LINES, COLS */
#include "lib/tty/win.h" /* do_enter_ca_mode() */ #include "lib/tty/win.h" /* do_enter_ca_mode() */
@ -94,6 +101,7 @@ dialog_switch_goto (GList * dlg)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#if defined TIOCGWINSZ
static void static void
dlg_resize_cb (void *data, void *user_data) dlg_resize_cb (void *data, void *user_data)
{ {
@ -102,6 +110,7 @@ dlg_resize_cb (void *data, void *user_data)
(void) user_data; (void) user_data;
d->callback (d, NULL, DLG_RESIZE, 0, NULL); d->callback (d, NULL, DLG_RESIZE, 0, NULL);
} }
#endif
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
/*** public functions ****************************************************************************/ /*** public functions ****************************************************************************/

View File

@ -55,7 +55,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>

View File

@ -26,22 +26,10 @@
#include <config.h> #include <config.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
/*
* If TIOCGWINSZ supported, make it available here, because window-
* resizing code depends on it...
*/
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#include <termios.h>
#include <unistd.h> #include <unistd.h>
#include "lib/global.h" #include "lib/global.h"
@ -49,7 +37,6 @@
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/tty/key.h" #include "lib/tty/key.h"
#include "lib/tty/mouse.h" #include "lib/tty/mouse.h"
#include "lib/tty/win.h" /* do_enter_ca_mode() */
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/vfs/vfs.h" /* For vfs_translate_url() */ #include "lib/vfs/vfs.h" /* For vfs_translate_url() */
#include "lib/strutil.h" #include "lib/strutil.h"