~thalexander/unity/update-fsf-address

« back to all changes in this revision

Viewing changes to decorations/DecorationsDataPool.cpp

  • Committer: Marco Trevisan (Treviño)
  • Date: 2016-03-07 18:51:47 UTC
  • mfrom: (4080 unity)
  • mto: This revision was merged to the branch mainline in revision 4085.
  • Revision ID: mail@3v1n0.net-20160307185147-0p1m89up4tqfb6w1
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 
68
68
DataPool::DataPool()
69
69
{
70
 
  SetupCursors();
71
70
  SetupTextures();
72
71
 
73
72
  CompSize glow_size(texture::GLOW_SIZE, texture::GLOW_SIZE);
78
77
  unity::Settings::Instance().dpi_changed.connect(cb);
79
78
}
80
79
 
81
 
DataPool::~DataPool()
82
 
{
83
 
  auto* dpy = screen->dpy();
84
 
  for (auto cursor : edge_cursors_)
85
 
    XFreeCursor(dpy, cursor);
86
 
}
87
 
 
88
80
DataPool::Ptr const& DataPool::Get()
89
81
{
90
82
  if (instance_)
99
91
  instance_.reset();
100
92
}
101
93
 
102
 
void DataPool::SetupCursors()
103
 
{
104
 
  auto* dpy = screen->dpy();
105
 
  for (unsigned c = 0; c < edge_cursors_.size(); ++c)
106
 
    edge_cursors_[c] = XCreateFontCursor(dpy, EdgeTypeToCursorShape(Edge::Type(c)));
107
 
}
108
 
 
109
94
Cursor DataPool::EdgeCursor(Edge::Type type) const
110
95
{
111
 
  return edge_cursors_[unsigned(type)];
 
96
  return screen->cursorCache(EdgeTypeToCursorShape(type));
112
97
}
113
98
 
114
99
void DataPool::SetupTextures()