summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-12-18 19:43:36 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-12-18 19:43:36 +0100
commitd925d2afdcb49942603236d3a21484471711c079 (patch)
tree42e0b2446502381a263a6052f7b6bdfe02f57cef /unity-shared
parentda11d35290492b57f2cd5f214527fa3ce1b65089 (diff)
UScreen: cleanup code in GetMonitorAtPosition
(bzr r3884.9.5)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/UScreen.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/unity-shared/UScreen.cpp b/unity-shared/UScreen.cpp
index 976f2dbcb..6165ddf8b 100644
--- a/unity-shared/UScreen.cpp
+++ b/unity-shared/UScreen.cpp
@@ -74,13 +74,10 @@ int UScreen::GetPrimaryMonitor() const
int UScreen::GetMonitorAtPosition(int x, int y) const
{
- int idx = 0;
-
- for (auto const& monitor : monitors_)
+ for (unsigned i = 0; i < monitors_.size(); ++i)
{
- if (monitor.IsPointInside(x, y))
- return idx;
- ++idx;
+ if (monitors_[i].IsPointInside(x, y))
+ return i;
}
return gdk_screen_get_monitor_at_point(screen_, x, y);