diff options
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core.py b/src/core.py index d19443a8..ba2c7b1d 100644 --- a/src/core.py +++ b/src/core.py @@ -51,6 +51,7 @@ from text_buffer import TextBuffer from keyboard import read_char from theming import get_theme from fifo import Fifo +from windows import g_lock # http://xmpp.org/extensions/xep-0045.html#errorstatus ERROR_AND_STATUS_CODES = { @@ -73,8 +74,6 @@ possible_show = {'available':None, 'xa':'xa' } -resize_lock = threading.Lock() - Status = collections.namedtuple('Status', 'show message') class Core(object): @@ -176,6 +175,8 @@ class Core(object): self.timed_events = set() + self.connected_events = {} + self.autoload_plugins() def autoload_plugins(self): @@ -208,18 +209,21 @@ class Core(object): 'Just press Ctrl-n.' \ )) self.refresh_window() + def resize_global_information_win(self): """ Resize the global_information_win only once at each resize. """ - self.information_win.resize(self.information_win_size, tabs.Tab.width, - tabs.Tab.height - 2 - self.information_win_size, 0) + with g_lock: + self.information_win.resize(self.information_win_size, tabs.Tab.width, + tabs.Tab.height - 2 - self.information_win_size, 0) def resize_global_info_bar(self): """ Resize the GlobalInfoBar only once at each resize """ - self.tab_win.resize(1, tabs.Tab.width, tabs.Tab.height - 2, 0) + with g_lock: + self.tab_win.resize(1, tabs.Tab.width, tabs.Tab.height - 2, 0) def on_exception(self, typ, value, trace): """ @@ -560,7 +564,7 @@ class Core(object): if not body: return tab.add_message(body, time=None, nickname=nick_from, - forced_user=self.get_tab_by_name(room_from, tabs.MucTab).get_user_by_name(nick_from)) + forced_user=self.get_tab_by_name(room_from, tabs.MucTab).get_user_by_name(nick_from)) conversation = self.get_tab_by_name(jid.full, tabs.PrivateTab) if conversation and conversation.remote_wants_chatstates is None: if message['chat_state']: @@ -708,7 +712,7 @@ class Core(object): tabs.Tab.resize(self.stdscr) self.resize_global_information_win() self.resize_global_info_bar() - with resize_lock: + with g_lock: for tab in self.tabs: if config.get('lazy_resize', 'true') == 'true': tab.need_resize = True |