Code review comment for lp:~compiz-team/compiz-core/compiz-core.notify_occlusion_detection

Revision history for this message
Tim Penhey (thumper) wrote :

Hi Sam,

This screams for a private function. If that isn't possible for ABI break
reasons, please add a note to refactor ASAP.

"o" is a terrible name for a variable. Also, using the correct constructor
for the vector means avoiding a call to resize.

void WHATEVER::ComputeShadowsForScreen(Screen* screen)
{
  CompOption::Vector options(1);
  CompOption& option = options.back ();
  option = CompOption ("active", CompOption::TypeBool);
  option.value ().set (true);

  screen->handleCompizEvent ("decor", "occlusion_detection", options);
  foreach (CompWindow *cw,
           DecorScreen::get (screen)->cScreen->getWindowPaintList ())
  {
    DecorWindow::get (cw)->computeShadowRegion ();
  }
  option.value ().set (false);
  screen->handleCompizEvent ("decor", "occlusion_detection", options);
}

review: Needs Fixing

« Back to merge proposal