Changeset d39f68c
- Timestamp:
- May 29, 2010, 1:14:57 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- ae11191
- Parents:
- d106110
- git-author:
- David Benjamin <davidben@mit.edu> (05/27/10 16:33:36)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/29/10 13:14:57)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r4e33cb2 rd39f68c 475 475 * fail. 476 476 */ 477 static void _owl_global_get_size(int *lines, int *cols) {477 void owl_global_get_terminal_size(int *lines, int *cols) { 478 478 struct winsize size; 479 479 /* get the new size */ … … 492 492 } 493 493 494 void owl_global_resize(owl_global *g, int x, int y) {494 void owl_global_resize(owl_global *g, int lines, int cols) { 495 495 /* resize the screen. If x or y is 0 use the terminal size */ 496 496 if (!g->resizepending) return; 497 497 g->resizepending = 0; 498 498 499 _owl_global_get_size(&g->lines, &g->cols); 500 if (x != 0) { 501 g->lines = x; 502 } 503 if (y != 0) { 504 g->cols = y; 505 } 506 507 owl_window_resize(owl_window_get_screen(), g->lines, g->cols); 499 g->lines = lines; 500 g->cols = cols; 501 owl_window_recompute_position(owl_window_get_screen()); 508 502 509 503 owl_function_debugmsg("New size is %i lines, %i cols.", g->lines, g->cols); -
window.c
rd106110 rd39f68c 54 54 } 55 55 56 static void _screen_calculate_size(owl_window *screen, void *user_data) 57 { 58 owl_global *g = user_data; 59 int lines, cols; 60 owl_global_get_terminal_size(&lines, &cols); 61 if (!g->lines) g->lines = lines; 62 if (!g->cols) g->cols = cols; 63 owl_window_resize(screen, g->lines, g->cols); 64 } 65 56 66 owl_window *owl_window_get_screen(void) 57 67 { … … 62 72 screen = _owl_window_new(NULL, g.lines, g.cols, 0, 0); 63 73 screen->is_screen = 1; 74 owl_window_set_size_cb(screen, _screen_calculate_size, &g, 0); 64 75 owl_window_map(screen, 0); 65 76 }
Note: See TracChangeset
for help on using the changeset viewer.