From 02772872fd0aaf79cd4e33bc7c7a9433e0f62c82 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Thu, 19 Nov 2015 00:54:04 +0000 Subject: [PATCH] Minor optimzation. --- hotkey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotkey.py b/hotkey.py index 0d8630b4..686a3bd9 100644 --- a/hotkey.py +++ b/hotkey.py @@ -118,8 +118,8 @@ if platform == 'darwin': if config.getint('hotkey_always'): self.activated = True else: # Only trigger if game client is front process - active = [x for x in NSWorkspace.sharedWorkspace().runningApplications() if x.isActive()] - if active and active[0] and active[0].bundleIdentifier() == 'uk.co.frontier.EliteDangerous': + front = NSWorkspace.sharedWorkspace().frontmostApplication() + if front and front.bundleIdentifier() == 'uk.co.frontier.EliteDangerous': self.activated = True def acquire_start(self):