Changeset bc6d81d


Ignore:
Timestamp:
Sep 27, 2011, 4:19:08 PM (13 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
bbd0cf1 (diff), 8e40da74 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 8e40da7419b6431d25fbdbc22d60b91b64994bb4 into bbd0cf162e91b3b75e5ee8670e46db64431aa63b
File:
1 edited

Legend:

Unmodified
Added
Removed
  • window.c

    rf271129 r8e40da74  
    441441}
    442442
     443static bool _owl_window_is_subtree_dirty(owl_window *w)
     444{
     445  owl_window *child;
     446
     447  if (w->dirty)
     448    return true;
     449  for (child = w->child;
     450       child != NULL;
     451       child = child->next) {
     452    if (child->dirty_subtree)
     453      return true;
     454  }
     455  return false;
     456}
     457
    443458static void _owl_window_redraw_subtree(owl_window *w)
    444459{
    445460  FuncOneArg ptr = (FuncOneArg)_owl_window_redraw_subtree;
     461
    446462  if (!w->dirty_subtree)
    447463    return;
     464
    448465  _owl_window_redraw(w);
    449466  owl_window_children_foreach(w, first_arg_only, &ptr);
    450   w->dirty_subtree = 0;
     467
     468  /* Clear the dirty_subtree bit, unless a child doesn't have it
     469   * cleared because we dirtied a window in redraw. Dirtying a
     470   * non-descendant window during a redraw handler is
     471   * discouraged. Redraw will not break, but it is undefined whether
     472   * the dirty is delayed to the next event loop iteration. */
     473  if (_owl_window_is_subtree_dirty(w)) {
     474    owl_function_debugmsg("subtree still dirty after one iteration!");
     475  } else {
     476    w->dirty_subtree = 0;
     477  }
    451478}
    452479
Note: See TracChangeset for help on using the changeset viewer.