summaryrefslogtreecommitdiffstats
path: root/py3status/__init__.py
diff options
context:
space:
mode:
authorUltrabug <ultrabug@gentoo.org>2015-02-17 16:05:28 +0100
committerUltrabug <ultrabug@gentoo.org>2015-02-17 16:05:28 +0100
commit641676678de8e2c8762cd946a01bf3de4803b038 (patch)
tree1dc412d4b297f4c03f6c2af9a06601e26f1b0e79 /py3status/__init__.py
parent94ec542fe0f9aa192a0424d4c47de99ae34caf67 (diff)
clear cache of user modules on click events by default for maximal i3bar responsiveness
Diffstat (limited to 'py3status/__init__.py')
-rwxr-xr-xpy3status/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/py3status/__init__.py b/py3status/__init__.py
index f8a1dcf..f16a945 100755
--- a/py3status/__init__.py
+++ b/py3status/__init__.py
@@ -586,6 +586,11 @@ class Events(Thread):
"""
Dispatch the event or enforce the default clear cache action.
"""
+ module_name = '{} {}'.format(
+ module.module_name,
+ module.module_inst
+ ).strip()
+ #
if module.click_events:
# module accepts click_events, use it
module.click_event(event)
@@ -593,10 +598,13 @@ class Events(Thread):
syslog(LOG_INFO, 'dispatching event {}'.format(event))
else:
# default button 2 action is to clear this method's cache
- obj['cached_until'] = time()
if self.config['debug']:
syslog(LOG_INFO, 'dispatching default event {}'.format(event))
+ # to make the bar more responsive to users we ask for a refresh
+ # of the module or of i3status if the module is an i3status one
+ self.refresh(module_name)
+
def i3bar_click_events_module(self):
"""
Detect the presence of the special i3bar_click_events.py module.