~unity-team/unity/trusty

« back to all changes in this revision

Viewing changes to launcher/EdgeBarrierController.cpp

  • Committer: CI Train Bot
  • Author(s): Andrea Azzarone
  • Date: 2015-03-16 17:29:41 UTC
  • mfrom: (3807.3.1 lp-1401911-trusty)
  • Revision ID: ci-train-bot@canonical.com-20150316172941-8e8gf0bgxgmjz6bx
disabled Pointer Barriers during lockscreen Fixes: #1401911
Approved by: Christopher Townsend

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
    ResizeBarrierList(layout);
92
92
    SetupBarriers(layout);
93
93
  }));*/
 
94
 
94
95
  uscreen->changed.connect(sigc::mem_fun(this, &EdgeBarrierController::Impl::OnUScreenChanged));
95
96
 
 
97
  parent_->force_disable.changed.connect([this] (bool) {
 
98
    auto monitors = UScreen::GetDefault()->GetMonitors();
 
99
    ResizeBarrierList(monitors);
 
100
    SetupBarriers(monitors);
 
101
  });
 
102
 
96
103
  parent_->sticky_edges.SetGetterFunction([this] {
97
104
    return parent_->options() ? parent_->options()->edge_resist() : false;
98
105
  });
158
165
 
159
166
void EdgeBarrierController::Impl::ResizeBarrierList(std::vector<nux::Geometry> const& layout)
160
167
{
 
168
  if (parent_->force_disable)
 
169
  {
 
170
    vertical_barriers_.clear();
 
171
    horizontal_barriers_.clear();
 
172
    return;
 
173
  }
 
174
 
161
175
  auto num_monitors = layout.size();
162
176
 
163
177
  if (vertical_barriers_.size() > num_monitors)
197
211
 
198
212
void EdgeBarrierController::Impl::SetupBarriers(std::vector<nux::Geometry> const& layout)
199
213
{
 
214
  if (parent_->force_disable())
 
215
    return;
 
216
 
200
217
  bool edge_resist = parent_->sticky_edges();
201
218
 
202
219
  for (unsigned i = 0; i < layout.size(); i++)
437
454
}
438
455
 
439
456
EdgeBarrierController::EdgeBarrierController()
440
 
  : pimpl(new Impl(this))
 
457
  : force_disable(false)
 
458
  , pimpl(new Impl(this))
441
459
{}
442
460
 
443
461
EdgeBarrierController::~EdgeBarrierController()