Changeset d39f68c for global.c


Ignore:
Timestamp:
May 29, 2010, 1:14:57 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
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)
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
  • global.c

    r4e33cb2 rd39f68c  
    475475 * fail.
    476476 */
    477 static void _owl_global_get_size(int *lines, int *cols) {
     477void owl_global_get_terminal_size(int *lines, int *cols) {
    478478  struct winsize size;
    479479  /* get the new size */
     
    492492}
    493493
    494 void owl_global_resize(owl_global *g, int x, int y) {
     494void owl_global_resize(owl_global *g, int lines, int cols) {
    495495  /* resize the screen.  If x or y is 0 use the terminal size */
    496496  if (!g->resizepending) return;
    497497  g->resizepending = 0;
    498498
    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());
    508502
    509503  owl_function_debugmsg("New size is %i lines, %i cols.", g->lines, g->cols);
Note: See TracChangeset for help on using the changeset viewer.