mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 07:15:05 +00:00
The x11 SIGWINCH handler caused more problems than it solved.
This commit is contained in:
@@ -208,10 +208,6 @@ static int _setup_curses(void)
|
||||
|
||||
XC_LOG(("cursesprocess exiting from Xinitscr\n"));
|
||||
|
||||
/* Always trap SIGWINCH if the C library supports SIGWINCH */
|
||||
|
||||
XCursesSetSignal(SIGWINCH, XCursesSigwinchHandler);
|
||||
|
||||
atexit(XCursesExit);
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -135,7 +135,6 @@ int XC_read_socket(int, void *, int);
|
||||
int XC_write_display_socket_int(int);
|
||||
|
||||
int XCursesSetupX(int argc, char *argv[]);
|
||||
void XCursesSigwinchHandler(int signo);
|
||||
|
||||
#ifdef _HPUX_SOURCE
|
||||
# define FD_SET_CAST int *
|
||||
|
||||
23
x11/x11.c
23
x11/x11.c
@@ -505,23 +505,6 @@ signal_handler XCursesSetSignal(int signo, signal_handler action)
|
||||
#endif
|
||||
}
|
||||
|
||||
void XCursesSigwinchHandler(int signo)
|
||||
{
|
||||
PDC_LOG(("%s:XCursesSigwinchHandler() - called: SIGNO: %d\n",
|
||||
XCLOGMSG, signo));
|
||||
|
||||
/* Patch by: Georg Fuchs, georg.fuchs@rz.uni-regensburg.de
|
||||
02-Feb-1999 */
|
||||
|
||||
SP->resized += 1;
|
||||
|
||||
/* Always trap SIGWINCH if the C library supports SIGWINCH */
|
||||
|
||||
#ifdef SIGWINCH
|
||||
XCursesSetSignal(SIGWINCH, XCursesSigwinchHandler);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Convert character positions x and y to pixel positions, stored in
|
||||
xpos and ypos */
|
||||
|
||||
@@ -2670,19 +2653,15 @@ static void _handle_structure_notify(Widget w, XtPointer client_data,
|
||||
XC_LOG(("ConfigureNotify received\n"));
|
||||
|
||||
/* Window has been resized, change width and height to send to
|
||||
place_text and place_graphics in next Expose. Also will need
|
||||
to kill (SIGWINCH) curses process if screen size changes. */
|
||||
place_text and place_graphics in next Expose. */
|
||||
|
||||
resize_window_width = event->xconfigure.width;
|
||||
resize_window_height = event->xconfigure.height;
|
||||
|
||||
after_first_curses_request = FALSE;
|
||||
|
||||
#ifdef SIGWINCH
|
||||
SP->resized = 1;
|
||||
|
||||
kill(xc_otherpid, SIGWINCH);
|
||||
#endif
|
||||
_send_key_to_curses(KEY_RESIZE, NULL, TRUE);
|
||||
break;
|
||||
|
||||
|
||||
@@ -60,10 +60,6 @@ static int _setup_curses(void)
|
||||
LINES = XCursesLINES - SP->linesrippedoff - SP->slklines;
|
||||
XCursesCOLS = COLS = SP->cols;
|
||||
|
||||
/* Always trap SIGWINCH if the C library supports SIGWINCH */
|
||||
|
||||
XCursesSetSignal(SIGWINCH, XCursesSigwinchHandler);
|
||||
|
||||
atexit(XCursesExit);
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -131,7 +131,6 @@ unsigned long XCursesMouse(XEvent *);
|
||||
int XCursesInitscr(int, char **);
|
||||
|
||||
int XCursesSetupX(int argc, char *argv[]);
|
||||
void XCursesSigwinchHandler(int signo);
|
||||
|
||||
#ifdef _HPUX_SOURCE
|
||||
# define FD_SET_CAST int *
|
||||
|
||||
24
x11new/x11.c
24
x11new/x11.c
@@ -503,23 +503,6 @@ signal_handler XCursesSetSignal(int signo, signal_handler action)
|
||||
#endif
|
||||
}
|
||||
|
||||
void XCursesSigwinchHandler(int signo)
|
||||
{
|
||||
PDC_LOG(("%s:XCursesSigwinchHandler() - called: SIGNO: %d\n",
|
||||
XCLOGMSG, signo));
|
||||
|
||||
/* Patch by: Georg Fuchs, georg.fuchs@rz.uni-regensburg.de
|
||||
02-Feb-1999 */
|
||||
|
||||
SP->resized += 1;
|
||||
|
||||
/* Always trap SIGWINCH if the C library supports SIGWINCH */
|
||||
|
||||
#ifdef SIGWINCH
|
||||
XCursesSetSignal(SIGWINCH, XCursesSigwinchHandler);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Convert character positions x and y to pixel positions, stored in
|
||||
xpos and ypos */
|
||||
|
||||
@@ -2354,17 +2337,12 @@ static void _handle_structure_notify(Widget w, XtPointer client_data,
|
||||
XC_LOG(("ConfigureNotify received\n"));
|
||||
|
||||
/* Window has been resized, change width and height to send to
|
||||
place_text and place_graphics in next Expose. Also will need
|
||||
to kill (SIGWINCH) curses process if screen size changes. */
|
||||
place_text and place_graphics in next Expose. */
|
||||
|
||||
resize_window_width = event->xconfigure.width;
|
||||
resize_window_height = event->xconfigure.height;
|
||||
|
||||
#ifdef SIGWINCH
|
||||
SP->resized = 1;
|
||||
|
||||
#endif
|
||||
//_send_key_to_curses(KEY_RESIZE, NULL, TRUE);
|
||||
xc_resize_now = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user