Skip to content

Commit

Permalink
Fix types in Process args, remove hardcoded development False
Browse files Browse the repository at this point in the history
  • Loading branch information
xylix committed Apr 22, 2020
1 parent 04d8269 commit 3ad2af6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions aw_watcher_window/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def getTitle(info: str) -> str:

def background_ensure_permissions() -> None:
from multiprocessing import Process
# TODO: remove print before merging
print("Starting permission check thread")
permission_process = Process(target=ensure_permissions, args=([]))
permission_process = Process(target=ensure_permissions, args=(()))
permission_process.start()
permission_process.join()
return
Expand All @@ -30,8 +28,7 @@ def background_ensure_permissions() -> None:
def ensure_permissions() -> None:
from ApplicationServices import AXIsProcessTrusted
from AppKit import NSAlert, NSAlertFirstButtonReturn, NSWorkspace, NSURL
#accessibility_permissions = AXIsProcessTrusted()
accessibility_permissions = False
accessibility_permissions = AXIsProcessTrusted()
if not accessibility_permissions:
title = "Missing accessibility permissions"
info = "To let ActivityWatch capture window titles grant it accessibility permissions. \n If you've already given ActivityWatch accessibility permissions and are still seeing this dialog, try removing and re-adding them."
Expand All @@ -42,8 +39,7 @@ def ensure_permissions() -> None:

ok_button = alert.addButtonWithTitle_("Open accessibility settings")

# Is cancel a good name here since the user isn't really cancelling anything?
alert.addButtonWithTitle_("Cancel")
alert.addButtonWithTitle_("Close")
choice = alert.runModal()
print(choice)
if choice == NSAlertFirstButtonReturn:
Expand Down

0 comments on commit 3ad2af6

Please sign in to comment.