summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-07-19 01:24:13 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-07-19 01:24:13 +0200
commite96ebed082daf9a91ecbe2eaed9fd19fdfe674c0 (patch)
treeb793933e2a0f7cfd7ddadcf6fe3ddbbae3bdd6bf
parent4fcff3e70219ad96a1876c1b8a4d81bf126ed745 (diff)
EdgeBarrierController: use the barrier's released property to disable the sticky edge
(bzr r2509.1.10)
-rw-r--r--launcher/EdgeBarrierController.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/launcher/EdgeBarrierController.cpp b/launcher/EdgeBarrierController.cpp
index 0ca778eee..83f74cfcb 100644
--- a/launcher/EdgeBarrierController.cpp
+++ b/launcher/EdgeBarrierController.cpp
@@ -40,13 +40,11 @@ struct EdgeBarrierController::Impl
Decaymulator decaymulator_;
glib::Source::UniquePtr release_timeout_;
float edge_overcome_pressure_;
- bool disabled_;
EdgeBarrierController* parent_;
};
EdgeBarrierController::Impl::Impl(EdgeBarrierController *parent)
: edge_overcome_pressure_(0)
- , disabled_(false)
, parent_(parent)
{
UScreen *uscreen = UScreen::GetDefault();
@@ -137,7 +135,7 @@ void EdgeBarrierController::Impl::OnPointerBarrierEvent(ui::PointerBarrierWrappe
process = false;
}
- if (process && disabled_)
+ if (process && owner->released)
{
BarrierRelease(owner, event->event_id);
}
@@ -159,11 +157,11 @@ void EdgeBarrierController::Impl::OnPointerBarrierEvent(ui::PointerBarrierWrappe
void EdgeBarrierController::Impl::BarrierRelease(ui::PointerBarrierWrapper* owner, int event)
{
owner->ReleaseBarrier(event);
+ owner->released = true;
decaymulator_.value = 0;
- disabled_ = true;
- release_timeout_.reset(new glib::Timeout(1000, [&disabled_] {
- disabled_ = false;
+ release_timeout_.reset(new glib::Timeout(1000, [owner] {
+ owner->released = false;
return false;
}));
}