~ubuntu-branches/ubuntu/precise/compiz/precise

« back to all changes in this revision

Viewing changes to plugins/decor/src/clip-groups/src/clip-groups.cpp

  • Committer: Package Import Robot
  • Author(s): Didier Roche, Didier Roche, Oliver Grawert
  • Date: 2012-04-11 18:35:39 UTC
  • mfrom: (0.168.18)
  • Revision ID: package-import@ubuntu.com-20120411183539-rriywj3uggp1uxfu
Tags: 1:0.9.7.6-0ubuntu1
[ Didier Roche ]
* New upstream release:
  - Memory leak in dlloaderListPlugins (LP: #968985)
  - priv->invisible is not updated when the window is mapped (LP: #969102)
  - window management, multi-monitor - In multi-monitor environment, windows
    should spread on the monitor in which they reside (LP: #919139)
  - Drop-down menus look disembodied from their titles (LP: #659816)
  - Improve performace of the shadow clipping code (LP: #931883)
  - DecorWindow::computeShadowRegion called way too much (LP: #969101)
  - white box randomly shows up at top left corner blocking application
    from using stuff under it (LP: #940603)
* Rebuild against latest metacity to get the HUD key configuration
  exposed in unity 3D as well (LP: #969256)
* debian/patches/ubuntu-config.patch:
  - set multioutput_mode to all outputs (windows to be scaled on each the
    monitor they are on only) (LP: #919139)
* debian/patches/fix_976467.patch:
  - Fix shadows being clipped incorrectly (LP: #976467)

[ Oliver Grawert ]
* update the GLES2 patch for the new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "clip-groups.h"
 
2
#include <boost/foreach.hpp>
 
3
#include <algorithm>
 
4
 
 
5
#ifndef foreach
 
6
#define foreach BOOST_FOREACH
 
7
#endif
 
8
 
 
9
using namespace compiz::decor;
 
10
using namespace compiz::decor::impl;
 
11
 
 
12
DecorClippableInterface::~DecorClippableInterface () {}
 
13
DecorClipGroupInterface::~DecorClipGroupInterface () {}
 
14
 
 
15
bool
 
16
GenericDecorClipGroup::doPushClippable (DecorClippableInterface *dc)
 
17
{
 
18
    std::vector <DecorClippableInterface *>::iterator it = std::find (mClippables.begin (),
 
19
                                                                      mClippables.end (),
 
20
                                                                      dc);
 
21
 
 
22
    if (it == mClippables.end ())
 
23
    {
 
24
        mClippables.push_back (dc);
 
25
        regenerateClipRegion ();
 
26
        dc->setOwner (this);
 
27
 
 
28
        return true;
 
29
    }
 
30
 
 
31
    return false;
 
32
}
 
33
 
 
34
bool
 
35
GenericDecorClipGroup::doPopClippable (DecorClippableInterface *dc)
 
36
{
 
37
    std::vector <DecorClippableInterface *>::iterator it = std::find (mClippables.begin (),
 
38
                                                                      mClippables.end (),
 
39
                                                                      dc);
 
40
 
 
41
    if (it != mClippables.end ())
 
42
    {
 
43
        dc->setOwner (NULL);
 
44
        dc->updateShadow (emptyRegion);
 
45
        mClippables.erase (it);
 
46
        regenerateClipRegion ();
 
47
 
 
48
        return true;
 
49
    }
 
50
 
 
51
    return false;
 
52
}
 
53
 
 
54
void
 
55
GenericDecorClipGroup::doRegenerateClipRegion ()
 
56
{
 
57
    mRegion -= infiniteRegion;
 
58
 
 
59
    foreach (DecorClippableInterface *clippable, mClippables)
 
60
    {
 
61
        mRegion += clippable->inputRegion ();
 
62
    }
 
63
}
 
64
 
 
65
const CompRegion &
 
66
GenericDecorClipGroup::getClipRegion ()
 
67
{
 
68
    return mRegion;
 
69
}
 
70
 
 
71
void
 
72
GenericDecorClipGroup::doUpdateAllShadows ()
 
73
{
 
74
    foreach (DecorClippableInterface *clippable, mClippables)
 
75
        clippable->updateShadow (mRegion);
 
76
}