Skip to content

Commit

Permalink
#1137: power events seem to work without crashing so enable the sleep…
Browse files Browse the repository at this point in the history
… handler by default again

git-svn-id: https://xpra.org/svn/Xpra/trunk@12271 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 29, 2016
1 parent 2720db5 commit 85f0c3e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/xpra/platform/darwin/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from xpra.log import Logger
log = Logger("osx", "events")

SLEEP_HANDLER = os.environ.get("XPRA_OSX_SLEEP_HANDLER", "0")=="1"
SLEEP_HANDLER = os.environ.get("XPRA_OSX_SLEEP_HANDLER", "1")=="1"


exit_cb = None
Expand Down Expand Up @@ -342,8 +342,11 @@ def setup_event_listener(self):
class Delegate(NSObject):
def applicationDidFinishLaunching_(self, notification):
log("applicationDidFinishLaunching_(%s)", notification)
if not SLEEP_HANDLER:
return
if SLEEP_HANDLER:
self.register_sleep_handlers()

def register_sleep_handlers(self):
log("register_sleep_handlers()")
workspace = NSWorkspace.sharedWorkspace()
notificationCenter = workspace.notificationCenter()
notificationCenter.addObserver_selector_name_object_(self, self.receiveSleepNotification_,
Expand Down

0 comments on commit 85f0c3e

Please sign in to comment.