from kivy.properties import ListProperty, StringProperty
from ..lock import Lock
+from kivy.clock import mainthread
+
__all__ = ["ActionList",
"ActionListIcons", "ActionListIcon",
"ActionListDescriptions", "ActionListDescription"]
action_title = StringProperty("")
action_list = ListProperty([])
+ @mainthread
def update_list(self, key, action_descriptions):
if key.repeat_delay > 0:
self.action_title = _(
from kivy.uix.stacklayout import StackLayout
from kivy.uix.relativelayout import RelativeLayout
from kivy.properties import ListProperty
-from kivy.clock import Clock
+from kivy.clock import Clock, mainthread
from ..helpers import duration_to_min_sec
from ..lock import Lock
super(PlayList, self).__init__(**kwargs)
Clock.schedule_interval(self.update_playlist, 0.5)
+ @mainthread
def update_playlist(self, dt):
if self.parent is None or 'Mapping' not in self.parent.ids:
return True
import threading
from transitions.extensions import HierarchicalMachine as Machine
+# All drawing operations should happen in the main thread
+# https://github.com/kivy/kivy/wiki/Working-with-Python-threads-inside-a-Kivy-application
+from kivy.clock import mainthread
+
class KeyMachine(Widget):
STATES = [
'initial',
def is_loaded_inactive(self):
return self.is_loaded_no_config() or self.is_loaded_no_actions()
+ @mainthread
def on_enter_configuring(self):
self.destroy_actions()
self.key.unset_description()
self.key.repeat_protection_finished()
# Callbacks
+ @mainthread
def key_loaded_callback(self):
self.key.parent.key_loaded_callback()
super(Key, self).__init__(**kwargs)
# Kivy events
+ @mainthread
+ def update_state(self, value):
+ self.machine_state = value
+
def on_key_sym(self, key, key_sym):
if key_sym != "":
self.configure()