Changeset d39f68c for window.c


Ignore:
Timestamp:
May 29, 2010, 1:14:57 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, 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)
Message:
Compute the terminal size in the screen's size callback

We do some roundabout thing with clearing g->lines and g->cols to
preserve the old logic of allowing us to force a value. (Not that it was
every used. We also apparently flipped x and y.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • window.c

    rd106110 rd39f68c  
    5454}
    5555
     56static 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
    5666owl_window *owl_window_get_screen(void)
    5767{
     
    6272    screen = _owl_window_new(NULL, g.lines, g.cols, 0, 0);
    6373    screen->is_screen = 1;
     74    owl_window_set_size_cb(screen, _screen_calculate_size, &g, 0);
    6475    owl_window_map(screen, 0);
    6576  }
Note: See TracChangeset for help on using the changeset viewer.