summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorBrandon Schaefer <brandon.schaefer@canonical.com>2013-01-09 11:23:39 -0800
committerBrandon Schaefer <brandon.schaefer@canonical.com>2013-01-09 11:23:39 -0800
commit74a531593721108f8413d8b2a0ef94df5896af0f (patch)
tree6314e72ecc3aecc0e2f74b2f0197f30f1f3b0a48 /unity-shared
parentb7f923bd91dae96aec5d5cb46a1f1a2008c727e0 (diff)
* Remove the std::find, and add a check if no other window on the stack is found
(bzr r3024.1.4)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/BamfApplicationManager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/unity-shared/BamfApplicationManager.cpp b/unity-shared/BamfApplicationManager.cpp
index 0df09708e..b45b2eb48 100644
--- a/unity-shared/BamfApplicationManager.cpp
+++ b/unity-shared/BamfApplicationManager.cpp
@@ -538,13 +538,12 @@ ApplicationWindowPtr Manager::GetActiveWindow()
// No transfer of ownership for bamf_matcher_get_active_window.
BamfWindow* active_win = bamf_matcher_get_active_window(matcher_);
+ if (!active_win)
+ return result;
+
std::vector<Window> const& our_xids = nux::XInputWindow::NativeHandleList();
Window xid = bamf_window_get_xid(active_win);
- // First check if the active window is not an Unity window
- if (std::find(our_xids.begin(), our_xids.end(), xid) == our_xids.end())
- active_win = nullptr;
-
// If the active window is a dock type, then we want the first visible, non-dock type.
if ((active_win && bamf_window_get_window_type(active_win) == BAMF_WINDOW_DOCK))
{
@@ -572,6 +571,9 @@ ApplicationWindowPtr Manager::GetActiveWindow()
active_win = win;
}
}
+
+ if (bamf_window_get_window_type(active_win) == BAMF_WINDOW_DOCK)
+ active_win = NULL;
}
auto view = reinterpret_cast<BamfView*>(active_win);