mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-02 17:24:27 +02:00
xsecurelock: check clock more often
timeout_add is using a monotonic clock and therefore, we need to check for updates more often.
This commit is contained in:
parent
2447dcb575
commit
505786cefe
1 changed files with 5 additions and 3 deletions
|
@ -129,9 +129,11 @@ def on_background_change(monitor, f1, f2, event, ctx):
|
|||
|
||||
def on_clock_change(ctx):
|
||||
now = datetime.datetime.now()
|
||||
ctx.clock = now.strftime("%H:%M")
|
||||
ctx.overlay.queue_draw()
|
||||
GLib.timeout_add((60 - now.second) * 1000, on_clock_change, ctx)
|
||||
new_clock = now.strftime("%H:%M")
|
||||
if new_clock != ctx.clock:
|
||||
ctx.clock = new_clock
|
||||
ctx.overlay.queue_draw()
|
||||
GLib.timeout_add(min(60 - now.second, 3) * 1000, on_clock_change, ctx)
|
||||
|
||||
|
||||
def on_weather_change(monitor, f1, f2, event, ctx):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue