diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-11-07 01:02:03 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-11-07 01:02:03 +0100 |
commit | 8911f85a4201b48670022226168b749dfa89fbb8 (patch) | |
tree | 607f7f7347752f78671a75f0ba3c95a307e96fe2 /src/core.py | |
parent | b7027e53474c208d7b772794fd34b30092bc4df1 (diff) | |
parent | 0315b05f5122f1f4697699fc09de1b0860203177 (diff) | |
download | poezio-8911f85a4201b48670022226168b749dfa89fbb8.tar.gz poezio-8911f85a4201b48670022226168b749dfa89fbb8.tar.bz2 poezio-8911f85a4201b48670022226168b749dfa89fbb8.tar.xz poezio-8911f85a4201b48670022226168b749dfa89fbb8.zip |
Merge branch 'master' into plugins
Conflicts:
src/core.py
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core.py b/src/core.py index 8e85ce90..4f0ba1fa 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): @@ -208,18 +207,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): """ @@ -559,7 +561,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']: @@ -706,7 +708,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 |