summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-17 13:53:04 +0200
committermathieui <mathieui@mathieui.net>2021-04-17 13:53:22 +0200
commit116c167e9ac545aca978ced8afa3ba236ef5a60f (patch)
tree061726238fe0bdf7ae229e6b938ead2b8daaa999
parent11de2d98b3a734ffcd4641a7c5b7affeb47844f6 (diff)
downloadpoezio-116c167e9ac545aca978ced8afa3ba236ef5a60f.tar.gz
poezio-116c167e9ac545aca978ced8afa3ba236ef5a60f.tar.bz2
poezio-116c167e9ac545aca978ced8afa3ba236ef5a60f.tar.xz
poezio-116c167e9ac545aca978ced8afa3ba236ef5a60f.zip
fix: allow certificate confirm dialog resize
fixes #3371
-rw-r--r--poezio/core/core.py2
-rw-r--r--poezio/core/handlers.py14
2 files changed, 11 insertions, 5 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 3ab5c600..2af292f1 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -617,7 +617,7 @@ class Core:
pass
sys.__excepthook__(typ, value, trace)
- def sigwinch_handler(self):
+ def sigwinch_handler(self, *args):
"""A work-around for ncurses resize stuff, which sucks. Normally, ncurses
catches SIGWINCH itself. In its signal handler, it updates the
windows structures (for example the size, etc) and it
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index a8226541..6262a1d5 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -10,6 +10,7 @@ import asyncio
import curses
import functools
import select
+import signal
import ssl
import sys
import time
@@ -1463,11 +1464,16 @@ class HandlerCore:
self.core.add_tab(confirm_tab, True)
self.core.doupdate()
+ # handle resize
+ prev_value = signal.signal(signal.SIGWINCH, self.core.sigwinch_handler)
while not confirm_tab.done:
- sel = select.select([sys.stdin], [], [], 5)[0]
-
- if sel:
- self.core.on_input_readable()
+ try:
+ sel = select.select([sys.stdin], [], [], 0.5)[0]
+ if sel:
+ self.core.on_input_readable()
+ except:
+ continue
+ signal.signal(signal.SIGWINCH, prev_value)
def validate_ssl(self, pem):
"""