commit 57bbe6262d9e04657933e47a88f771e44f4a28ea
parent 6d72663e9fcc44d229709beac2924c8ed96d6ad2
Author: hhvn <dev@hhvn.uk>
Date: Fri, 12 Nov 2021 15:20:01 +0000
handle.c hist.c main.c struct.h ui.c: redraw --> refresh
Diffstat:
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/handle.c b/handle.c
@@ -54,7 +54,7 @@ handle_JOIN(char *msg, char **params, struct Server *server, time_t timestamp) {
if (nick_isself(nick))
ui_select(server, chan);
else if (selected.channel == chan)
- windows[Win_nicklist].redraw = 1;
+ windows[Win_nicklist].refresh = 1;
nick_free(nick);
}
@@ -81,7 +81,7 @@ handle_PART(char *msg, char **params, struct Server *server, time_t timestamp) {
} else {
nick_remove(&chan->nicks, nick->nick);
if (chan == selected.channel)
- windows[Win_nicklist].redraw = 1;
+ windows[Win_nicklist].refresh = 1;
}
hist_add(server->history, nick, msg, params, Activity_status, timestamp, HIST_LOG);
@@ -102,14 +102,14 @@ handle_QUIT(char *msg, char **params, struct Server *server, time_t timestamp) {
/* TODO: umm, sound like a big deal anyone? */
(void)0;
}
-
+
hist_add(server->history, nick, msg, params, Activity_status, timestamp, HIST_LOG);
for (chan = server->channels; chan; chan = chan->next) {
if (nick_get(&chan->nicks, nick->nick) != NULL) {
nick_remove(&chan->nicks, nick->nick);
hist_add(chan->history, nick, msg, params, Activity_status, timestamp, HIST_SHOW);
if (chan == selected.channel)
- windows[Win_nicklist].redraw = 1;
+ windows[Win_nicklist].refresh = 1;
}
}
@@ -231,7 +231,7 @@ handle_NAMREPLY(char *msg, char **params, struct Server *server, time_t timestam
}
if (selected.channel == chan)
- windows[Win_nicklist].redraw = 1;
+ windows[Win_nicklist].refresh = 1;
param_free(nicksref);
}
@@ -277,7 +277,7 @@ handle_NICK(char *msg, char **params, struct Server *server, time_t timestamp) {
nick_add(&chan->nicks, prefix, chnick->priv, server);
nick_remove(&chan->nicks, nick->nick);
if (selected.channel == chan)
- windows[Win_nicklist].redraw = 1;
+ windows[Win_nicklist].refresh = 1;
}
}
}
diff --git a/hist.c b/hist.c
@@ -99,7 +99,7 @@ hist_add(struct HistInfo *histinfo, struct Nick *from,
/* TODO: this triggers way too often, need to have some sort of delay */
if (selected.history == histinfo)
- windows[Win_main].redraw = 1;
+ windows[Win_main].refresh = 1;
if (options & HIST_LOG) {
if (histinfo->server)
diff --git a/main.c b/main.c
@@ -261,13 +261,13 @@ main(int argc, char **argv) {
if (oldselected.channel != selected.channel || oldselected.server != selected.server) {
if (windows[Win_nicklist].location)
- windows[Win_nicklist].redraw = 1;
+ windows[Win_nicklist].refresh = 1;
if (windows[Win_buflist].location)
- windows[Win_buflist].redraw = 1;
+ windows[Win_buflist].refresh = 1;
}
if (oldselected.history != selected.history)
- windows[Win_main].redraw = 1;
+ windows[Win_main].refresh = 1;
oldselected.channel = selected.channel;
oldselected.server = selected.server;
@@ -278,17 +278,17 @@ main(int argc, char **argv) {
uineedredraw = 0;
ui_redraw();
for (i=0; i < Win_last; i++)
- windows[i].redraw = 0;
+ windows[i].refresh = 0;
continue;
}
refreshed = inputrefreshed = 0;
for (i=0; i < Win_last; i++) {
- if (windows[i].redraw && windows[i].location) {
+ if (windows[i].refresh && windows[i].location) {
if (windows[i].handler)
windows[i].handler();
wnoutrefresh(windows[i].window);
- windows[i].redraw = 0;
+ windows[i].refresh = 0;
refreshed = 1;
if (i == Win_input)
inputrefreshed = 1;
diff --git a/struct.h b/struct.h
@@ -162,7 +162,7 @@ enum WindowLocation {
struct Window {
int x, y;
int h, w;
- int redraw;
+ int refresh;
enum WindowLocation location;
void (*handler)(void);
WINDOW *window;
diff --git a/ui.c b/ui.c
@@ -149,12 +149,12 @@ ui_placewindow(struct Window *window) {
void
ui_read(void) {
- static int needredraw;
+ static int needrefresh;
int key;
switch (key = wgetch(windows[Win_input].window)) {
case ERR: /* no input received */
- if (needredraw) {
+ if (needrefresh) {
/* Only redraw the input window if there
* hasn't been any input received - this
* is to avoid forcing a redraw for each
@@ -165,8 +165,8 @@ ui_read(void) {
* Theoretically this could be done with
* bracketed paste stuff, but a solution
* that works with all terminals is nice */
- windows[Win_input].redraw = 1;
- needredraw = 0;
+ windows[Win_input].refresh = 1;
+ needrefresh = 0;
}
return;
case KEY_RESIZE:
@@ -199,7 +199,7 @@ ui_read(void) {
break;
}
- needredraw = 1;
+ needrefresh = 1;
}
int
@@ -311,7 +311,7 @@ ui_redraw(void) {
for (i = 0; i < Win_last; i++) {
ui_placewindow(&windows[i]);
- windows[i].redraw = 1;
+ windows[i].refresh = 1;
}
}