Skip to content

Commit

Permalink
monotonic time does not increase during sleep, use time instead
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@16070 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 14, 2017
1 parent 21fb71b commit 67a58ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import re
import sys
import time
import datetime
import traceback
import logging
Expand Down Expand Up @@ -692,14 +693,14 @@ def destroy_all_windows(self):

def suspend(self):
log.info("system is suspending")
self._suspended_at = monotonic_time()
self._suspended_at = time.time()
#tell the server to slow down refresh for all the windows:
self.control_refresh(-1, True, False)

def resume(self):
elapsed = 0
if self._suspended_at>0:
elapsed = monotonic_time()-self._suspended_at
elapsed = max(0, time.time()-self._suspended_at)
self._suspended_at = 0
delta = datetime.timedelta(seconds=int(elapsed))
log.info("system resumed, was suspended for %s", delta)
Expand Down

0 comments on commit 67a58ee

Please sign in to comment.