Merge lp://qastaging/~compiz-team/compiz-core/compiz-core.notify_occlusion_detection into lp://qastaging/compiz-core/0.9.5

Proposed by Sam Spilsbury
Status: Rejected
Rejected by: Sam Spilsbury
Proposed branch: lp://qastaging/~compiz-team/compiz-core/compiz-core.notify_occlusion_detection
Merge into: lp://qastaging/compiz-core/0.9.5
Diff against target: 93 lines (+44/-2)
1 file modified
plugins/decor/src/decor.cpp (+44/-2)
To merge this branch: bzr merge lp://qastaging/~compiz-team/compiz-core/compiz-core.notify_occlusion_detection
Reviewer Review Type Date Requested Status
Tim Penhey (community) Needs Fixing
Review via email: mp+73232@code.qastaging.launchpad.net
To post a comment you must log in.
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
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

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

Or keeping it ABI stable just a simple C-style static function that takes the object and the needed pointers to private members. That will make the post-Oneiric refactoring a 2-liner. In my experience it's better to get the structure right while you have your hands and mind in it anyway.

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

Good call Mikkel. I thought about that, but didn't say it.

Unmerged revisions

2798. By Sam Spilsbury

Notify that we're doing occlusion detection

2797. By Sam Spilsbury

Merge lp:~compiz-team/compiz-core/compiz-core.fix_831987

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches