about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-12-02 14:03:53 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-12-02 14:03:53 +0100
commit19de066008c69b24cc3d64a8781089e56d416a53 (patch)
tree882f630a5a5b9c23b501926253afcc1a0330443a /src
parent09b8802f51db9406c03cd7411bd1aae1f806d2a1 (diff)
downloadprofani-tty-19de066008c69b24cc3d64a8781089e56d416a53.tar.gz
Call ncurses resize function before move function
From @xaizek s comment on issue #1235:
```
If the move would cause the window to be off the screen, it is an error and the window
is not moved.

Resize on the other hand doesn't fail like this according to its documentation. So new size needs to be applied first.
```

Big thanks to @xaizek for taking a look at our code and helping us!!

Regards https://github.com/profanity-im/profanity/issues/1235
Diffstat (limited to 'src')
-rw-r--r--src/ui/statusbar.c2
-rw-r--r--src/ui/titlebar.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index 39b1ddbb..8f9900e1 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -137,8 +137,8 @@ status_bar_resize(void)
     int cols = getmaxx(stdscr);
     werase(statusbar_win);
     int row = screen_statusbar_row();
-    mvwin(statusbar_win, row, 0);
     wresize(statusbar_win, 1, cols);
+    mvwin(statusbar_win, row, 0);
 
     status_bar_draw();
 }
diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c
index 9cb2cfec..50b85932 100644
--- a/src/ui/titlebar.c
+++ b/src/ui/titlebar.c
@@ -108,9 +108,10 @@ title_bar_resize(void)
     werase(win);
 
     int row = screen_titlebar_row();
-    mvwin(win, row, 0);
 
     wresize(win, 1, cols);
+    mvwin(win, row, 0);
+
     wbkgd(win, theme_attrs(THEME_TITLE_TEXT));
 
     _title_bar_draw();