summaryrefslogtreecommitdiff
path: root/src/tabs
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-05-05 19:57:20 +0200
committermathieui <mathieui@mathieui.net>2014-05-05 20:01:04 +0200
commit9c8d577737cf523adce0306207dbb8a33b8aa63e (patch)
tree807b647210adf5d96ce081b14e63ab2a431e6869 /src/tabs
parentb8972ad94029f490ce4cb67d9aa8e2c921e13366 (diff)
downloadpoezio-9c8d577737cf523adce0306207dbb8a33b8aa63e.tar.gz
poezio-9c8d577737cf523adce0306207dbb8a33b8aa63e.tar.bz2
poezio-9c8d577737cf523adce0306207dbb8a33b8aa63e.tar.xz
poezio-9c8d577737cf523adce0306207dbb8a33b8aa63e.zip
Revert "Fix #2072 (only resize a tab if the size changed since the last display)"
This reverts commit b46f0f5e266c321632738ca40839759486b47a7e. Conflicts: src/tabs/muclisttab.py Doing this made the unresized elements refresh in the old subwins, causing glitches and weirdness. And anyway, the only problematic element is the TextWin (rebuilding all the lines of a buffer is expensive), but it already checks if the width changed.
Diffstat (limited to 'src/tabs')
-rw-r--r--src/tabs/basetabs.py9
-rw-r--r--src/tabs/conversationtab.py2
-rw-r--r--src/tabs/data_forms.py2
-rw-r--r--src/tabs/muctab.py3
-rw-r--r--src/tabs/privatetab.py3
-rw-r--r--src/tabs/rostertab.py2
-rw-r--r--src/tabs/xmltab.py2
7 files changed, 8 insertions, 15 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py
index d9225468..c1281e62 100644
--- a/src/tabs/basetabs.py
+++ b/src/tabs/basetabs.py
@@ -96,10 +96,10 @@ class Tab(object):
self._state = 'normal'
self._prev_state = None
+ self.need_resize = False
self.key_func = {} # each tab should add their keys in there
# and use them in on_input
self.commands = {} # and their own commands
- self._saved_size = (-1, -1)
@property
@@ -185,13 +185,6 @@ class Tab(object):
elif not self._prev_state:
self._state = 'normal'
- def push_size(self):
- self._saved_size = (self.height, self.width)
-
- @property
- def need_resize(self):
- return self._saved_size != (self.height, self.width)
-
@staticmethod
def resize(scr):
with g_lock:
diff --git a/src/tabs/conversationtab.py b/src/tabs/conversationtab.py
index ca6eee18..7480906b 100644
--- a/src/tabs/conversationtab.py
+++ b/src/tabs/conversationtab.py
@@ -260,6 +260,7 @@ class ConversationTab(ChatTab):
callback=callback)
def resize(self):
+ self.need_resize = False
if self.size.tab_degrade_y:
display_bar = False
info_win_height = 0
@@ -282,7 +283,6 @@ class ConversationTab(ChatTab):
- tab_win_height,
0)
self.input.resize(1, self.width, self.height - 1, 0)
- self.push_size()
def refresh(self):
if self.need_resize:
diff --git a/src/tabs/data_forms.py b/src/tabs/data_forms.py
index bdefbfde..776e476d 100644
--- a/src/tabs/data_forms.py
+++ b/src/tabs/data_forms.py
@@ -57,6 +57,7 @@ class DataFormsTab(Tab):
self.form_win.on_input(key)
def resize(self):
+ self.need_resize = False
self.topic_win.resize(1, self.width, 0, 0)
self.form_win.resize(self.height - 3 - Tab.tab_win_height(),
self.width, 1, 0)
@@ -64,7 +65,6 @@ class DataFormsTab(Tab):
self.help_win_dyn.resize(1, self.width,
self.height - 2 - Tab.tab_win_height(), 0)
self.lines = []
- self.push_size()
def refresh(self):
if self.need_resize:
diff --git a/src/tabs/muctab.py b/src/tabs/muctab.py
index ae97e993..201010f5 100644
--- a/src/tabs/muctab.py
+++ b/src/tabs/muctab.py
@@ -796,7 +796,7 @@ class MucTab(ChatTab):
"""
Resize the whole window. i.e. all its sub-windows
"""
- log.debug('RESIZE PLS')
+ self.need_resize = False
if config.get("hide_user_list", False) or self.size.tab_degrade_x:
display_user_list = False
text_width = self.width
@@ -833,7 +833,6 @@ class MucTab(ChatTab):
- tab_win_height,
0)
self.input.resize(1, self.width, self.height-1, 0)
- self.push_size()
def refresh(self):
if self.need_resize:
diff --git a/src/tabs/privatetab.py b/src/tabs/privatetab.py
index 2e7c6801..b8699bd2 100644
--- a/src/tabs/privatetab.py
+++ b/src/tabs/privatetab.py
@@ -237,6 +237,8 @@ class PrivateTab(ChatTab):
self.parent_muc.command_info(user)
def resize(self):
+ self.need_resize = False
+
if self.size.tab_degrade_y:
info_win_height = 0
tab_win_height = 0
@@ -252,7 +254,6 @@ class PrivateTab(ChatTab):
- tab_win_height,
0)
self.input.resize(1, self.width, self.height-1, 0)
- self.push_size()
def refresh(self):
if self.need_resize:
diff --git a/src/tabs/rostertab.py b/src/tabs/rostertab.py
index 34a4c553..81b5fcb5 100644
--- a/src/tabs/rostertab.py
+++ b/src/tabs/rostertab.py
@@ -266,6 +266,7 @@ class RosterInfoTab(Tab):
self.core.command_last_activity(jid)
def resize(self):
+ self.need_resize = False
if self.size.tab_degrade_x:
display_info = False
roster_width = self.width
@@ -301,7 +302,6 @@ class RosterInfoTab(Tab):
roster_width, 0, 0)
self.input.resize(1, self.width, self.height-1, 0)
self.default_help_message.resize(1, self.width, self.height-1, 0)
- self.push_size()
def completion(self):
# Check if we are entering a command (with the '/' key)
diff --git a/src/tabs/xmltab.py b/src/tabs/xmltab.py
index d56b82a8..57b55103 100644
--- a/src/tabs/xmltab.py
+++ b/src/tabs/xmltab.py
@@ -164,6 +164,7 @@ class XMLTab(Tab):
self.core.close_tab()
def resize(self):
+ self.need_resize = False
if self.size.tab_degrade_y:
info_win_size = 0
tab_win_height = 0
@@ -179,7 +180,6 @@ class XMLTab(Tab):
- tab_win_height,
0)
self.input.resize(1, self.width, self.height-1, 0)
- self.push_size()
def refresh(self):
if self.need_resize: