Changeset 4811422 for window.c


Ignore:
Timestamp:
Sep 18, 2010, 5:07:40 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
09ceee3
Parents:
5f0bcde
git-author:
David Benjamin <davidben@mit.edu> (08/15/10 16:25:03)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:40)
Message:
Delay realizing a window until we need it for painting

This avoids WINDOW churn if we show and hide windows a lot.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • window.c

    r5f0bcde r4811422  
    328328}
    329329
     330static void _owl_window_realize_later(owl_window *w)
     331{
     332  if (owl_window_is_realized(w) || !_owl_window_should_realize(w))
     333    return;
     334  owl_window_dirty(w);
     335}
     336
    330337static void _owl_window_realize(owl_window *w)
    331338{
     
    341348  owl_window_dirty(w);
    342349  /* map the children */
    343   owl_window_children_foreach(w, (GFunc)_owl_window_realize, 0);
     350  owl_window_children_foreach(w, (GFunc)_owl_window_realize_later, 0);
    344351}
    345352
     
    390397void owl_window_dirty(owl_window *w)
    391398{
    392   if (!owl_window_is_realized(w))
     399  if (!_owl_window_should_realize(w))
    393400    return;
    394401  if (!w->dirty) {
     
    409416{
    410417  if (!w->dirty) return;
     418  _owl_window_realize(w);
    411419  if (w->win && !w->is_screen) {
    412420    if (owl_window_is_subwin(w)) {
     
    493501  if (w->shown) {
    494502    /* ncurses is screwy: give up and recreate windows at the right place */
    495     _owl_window_realize(w);
     503    _owl_window_realize_later(w);
    496504  }
    497505}
Note: See TracChangeset for help on using the changeset viewer.