summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-31 15:15:16 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-01-31 15:15:16 +0100
commit89f337a4573ebbca513103340c9400b97950745c (patch)
treeabbaa7c222c14f6c70b339cf07fa2fb4837c92db /src
parent25fb16e8c5be1a26e76206b075c3eee96f0d9047 (diff)
downloadpoezio-89f337a4573ebbca513103340c9400b97950745c.tar.gz
poezio-89f337a4573ebbca513103340c9400b97950745c.tar.bz2
poezio-89f337a4573ebbca513103340c9400b97950745c.tar.xz
poezio-89f337a4573ebbca513103340c9400b97950745c.zip
Avoid crash if info_win_size is over the window height. fixed #2114
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 3370b60e..0667edb3 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -575,6 +575,8 @@ class MucTab(ChatTab):
Tab.resize(self)
if not self.visible:
return
+ if self.core.information_win_size >= self.height-3:
+ return
text_width = (self.width//10)*9
self.topic_win.resize(1, self.width, 0, 0, self.core.stdscr)
self.text_win.resize(self.height-4-self.core.information_win_size, text_width, 1, 0, self.core.stdscr)
@@ -656,6 +658,8 @@ class MucTab(ChatTab):
self.text_win.scroll_down(self.text_win.height-1)
def on_info_win_size_changed(self):
+ if self.core.information_win_size >= self.height-3:
+ return
text_width = (self.width//10)*9
self.text_win.resize(self.height-4-self.core.information_win_size, text_width, 1, 0, self.core.stdscr)
self.info_header.resize(1, (self.width//10)*9, self.height-3-self.core.information_win_size, 0, self.core.stdscr)
@@ -706,6 +710,8 @@ class PrivateTab(ChatTab):
Tab.resize(self)
if not self.visible:
return
+ if self.core.information_win_size >= self.height-3:
+ return
self.text_win.resize(self.height-3-self.core.information_win_size, self.width, 0, 0, self.core.stdscr)
self.text_win.rebuild_everything(self._room)
self.info_header.resize(1, self.width, self.height-3-self.core.information_win_size, 0, self.core.stdscr)
@@ -757,6 +763,8 @@ class PrivateTab(ChatTab):
self.text_win.scroll_down(self.text_win.height-1)
def on_info_win_size_changed(self):
+ if self.core.information_win_size >= self.height-3:
+ return
self.text_win.resize(self.height-3-self.core.information_win_size, self.width, 0, 0, self.core.stdscr)
self.info_header.resize(1, self.width, self.height-3-self.core.information_win_size, 0, self.core.stdscr)
self.info_win.resize(self.core.information_win_size, self.width, self.height-2-self.core.information_win_size, 0, self.core.stdscr, None)
@@ -1084,6 +1092,8 @@ class ConversationTab(ChatTab):
Tab.resize(self)
if not self.visible:
return
+ if self.core.information_win_size >= self.height-3:
+ return
self.text_win.resize(self.height-4-self.core.information_win_size, self.width, 1, 0, self.core.stdscr)
self.text_win.rebuild_everything(self._room)
self.upper_bar.resize(1, self.width, 0, 0, self.core.stdscr)
@@ -1137,6 +1147,8 @@ class ConversationTab(ChatTab):
self.text_win.scroll_down(self.text_win.height-1)
def on_info_win_size_changed(self):
+ if self.core.information_win_size >= self.height-3:
+ return
self.text_win.resize(self.height-3-self.core.information_win_size, self.width, 0, 0, self.core.stdscr)
self.info_header.resize(1, self.width, self.height-3-self.core.information_win_size, 0, self.core.stdscr)
self.info_win.resize(self.core.information_win_size, self.width, self.height-2-self.core.information_win_size, 0, self.core.stdscr)