From: Timo Korvola Date: Sat, 10 Feb 2018 17:12:47 +0000 (+0200) Subject: Clip cursor position to window sizes. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=a525d95b7de721c8d09d5eb07952ae3edc8bac49;p=liskon_frotz.git Clip cursor position to window sizes. This introduces an inconvenient dependency between resize_screen and unix_resize_screen. #42: Handle terminal resizing --- diff --git a/src/common/screen.c b/src/common/screen.c index c147f6b..c4bda9c 100644 --- a/src/common/screen.c +++ b/src/common/screen.c @@ -684,12 +684,20 @@ void resize_screen (void) { if (h_version != V6) { - wp[0].x_size = h_screen_width; + if (wp[0].x_cursor > h_screen_width) + wp[0].x_cursor = h_screen_width; wp[1].x_size = h_screen_width; + if (wp[1].x_cursor > h_screen_width) + wp[1].x_cursor = h_screen_width; wp[7].x_size = h_screen_width; + if (wp[7].x_cursor > h_screen_width) + wp[7].x_cursor = h_screen_width; + /*XXX This needs to be in sync with unix_resize_display. */ wp[0].y_size = h_screen_height - wp[1].y_size - wp[7].y_size; + if (wp[0].y_cursor > wp[0].y_size) + wp[0].y_cursor = wp[0].y_size; } }/* resize_screen */