Simplify the frame testing logic in callers to grab borders

A lot of code did something similar to:

  MetaFrameBorders borders;

  if (window->frame)
    meta_frame_calc_borders (window->frame, &borders);
  else
    meta_frame_borders_clear (&borders);

Sometimes, the else part was omitted and we were unknowingly using
uninitalized values for OR windows. Clean this up by just testing
for a NULL frame in meta_frame_calc_borders and clearing for the
caller if so.

https://bugzilla.gnome.org/show_bug.cgi?id=643606
This commit is contained in:
Jasper St. Pierre
2012-03-12 23:11:07 -04:00
parent 578b1c06c7
commit 8c1b2d5eda
4 changed files with 53 additions and 71 deletions

View File

@ -573,7 +573,7 @@ place_window_if_needed(MetaWindow *window,
META_MAXIMIZE_VERTICAL : 0), &info->current);
/* maximization may have changed frame geometry */
if (window->frame && !window->fullscreen)
if (!window->fullscreen)
meta_frame_calc_borders (window->frame, info->borders);
if (window->fullscreen_after_placement)