Skip to content

Commit

Permalink
Call ncurses resize function before move function
Browse files Browse the repository at this point in the history
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 #1235
  • Loading branch information
jubalh committed Dec 2, 2019
1 parent 09b8802 commit 19de066
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ui/statusbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion src/ui/titlebar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 19de066

Please sign in to comment.