Changeset d15ea5f for window.c


Ignore:
Timestamp:
Jun 2, 2010, 10:06:53 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:
f041595
Parents:
f91767d
Message:
Punt the moving optimization since begx and begy are wrong
File:
1 edited

Legend:

Unmodified
Added
Removed
  • window.c

    rf91767d rd15ea5f  
    415415void owl_window_move(owl_window *w, int begin_y, int begin_x)
    416416{
     417  owl_window_set_position(w, w->nlines, w->ncols, begin_y, begin_x);
     418#if 0
     419  /* This routine tries to move a window efficiently, but begy and begx are
     420   * then wrong. Currently, this only effects the wnoutrefresh to move cursor.
     421   * TODO: fix that and reinstate this code if it's worth the trouble */
    417422  if (w->is_screen) return; /* can't move the screen */
    418423  if (w->begin_y == begin_y && w->begin_x == begin_x) return;
     
    440445    _owl_window_realize(w);
    441446  }
     447#endif
    442448}
    443449
     
    449455  }
    450456
    451   if (w->nlines == nlines && w->ncols == ncols) {
    452     /* moving is easier */
    453     owl_window_move(w, begin_y, begin_x);
    454     return;
    455   }
    456 
    457   /* window is shown, we must try to have a window at the end */
    458   if (w->shown) {
    459     /* resizing in ncurses is hard: give up do a unrealize/realize */
    460     _owl_window_unrealize(w);
    461   }
     457  if (w->nlines == nlines && w->ncols == ncols
     458      && w->begin_y == begin_y && w->begin_x == begin_x) {
     459    return;
     460  }
     461
     462  _owl_window_unrealize(w);
    462463  w->begin_y = begin_y;
    463464  w->begin_x = begin_x;
     
    466467  g_signal_emit(w, window_signals[RESIZED], 0);
    467468  if (w->shown) {
     469    /* ncurses is screwy: give up and recreate windows at the right place */
    468470    _owl_window_realize(w);
    469471  }
Note: See TracChangeset for help on using the changeset viewer.