aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/list_window.c2
-rw-r--r--src/list_window.h5
-rw-r--r--src/screen_help.c2
-rw-r--r--src/screen_lyrics.c2
-rw-r--r--src/screen_play.c6
-rw-r--r--src/screen_search.c4
-rw-r--r--src/screen_song.c2
7 files changed, 11 insertions, 12 deletions
diff --git a/src/list_window.c b/src/list_window.c
index b12e8eb8c..ea4b3c28e 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -166,7 +166,7 @@ list_window_paint(struct list_window *lw,
{
unsigned i;
bool fill = options.wide_cursor;
- bool show_cursor = !(lw->flags & LW_HIDE_CURSOR);
+ bool show_cursor = !lw->hide_cursor;
if (show_cursor) {
if (lw->selected < lw->start)
diff --git a/src/list_window.h b/src/list_window.h
index bcf3e3228..8e9411acb 100644
--- a/src/list_window.h
+++ b/src/list_window.h
@@ -13,8 +13,6 @@
#include <ncurses.h>
#endif
-#define LW_HIDE_CURSOR 0x01
-
typedef const char *(*list_window_callback_fn_t)(unsigned index,
bool *highlight,
void *data);
@@ -26,7 +24,8 @@ typedef struct list_window {
unsigned start;
unsigned selected;
unsigned xoffset;
- int flags;
+
+ bool hide_cursor;
} list_window_t;
diff --git a/src/screen_help.c b/src/screen_help.c
index 0cc15a37a..c8a3d84eb 100644
--- a/src/screen_help.c
+++ b/src/screen_help.c
@@ -182,7 +182,7 @@ static void
help_init(WINDOW *w, int cols, int rows)
{
lw = list_window_init(w, cols, rows);
- lw->flags = LW_HIDE_CURSOR;
+ lw->hide_cursor = true;
}
static void
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index d54333d0c..e5635bd32 100644
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
@@ -245,7 +245,7 @@ lyrics_screen_init(WINDOW *w, int cols, int rows)
{
current.lines = g_ptr_array_new();
lw = list_window_init(w, cols, rows);
- lw->flags = LW_HIDE_CURSOR;
+ lw->hide_cursor = true;
}
static void
diff --git a/src/screen_play.c b/src/screen_play.c
index 7ee0a9ff4..5acde4568 100644
--- a/src/screen_play.c
+++ b/src/screen_play.c
@@ -396,7 +396,7 @@ timer_hide_cursor(gpointer data)
/* hide the cursor when mpd is playing and the user is inactive */
if (c->status != NULL && c->status->state == MPD_STATUS_STATE_PLAY) {
- lw->flags |= LW_HIDE_CURSOR;
+ lw->hide_cursor = true;
playlist_repaint();
} else
timer_hide_cursor_id = g_timeout_add(options.hide_cursor * 1000,
@@ -414,7 +414,7 @@ play_open(mpdclient_t *c)
assert(timer_hide_cursor_id == 0);
if (options.hide_cursor > 0) {
- lw->flags &= ~LW_HIDE_CURSOR;
+ lw->hide_cursor = false;
timer_hide_cursor_id = g_timeout_add(options.hide_cursor * 1000,
timer_hide_cursor, c);
}
@@ -530,7 +530,7 @@ handle_mouse_event(struct mpdclient *c)
static bool
play_cmd(mpdclient_t *c, command_t cmd)
{
- lw->flags &= ~LW_HIDE_CURSOR;
+ lw->hide_cursor = false;
if (options.hide_cursor > 0) {
if (timer_hide_cursor_id != 0)
diff --git a/src/screen_search.c b/src/screen_search.c
index 3c0a18bf9..235eeeecc 100644
--- a/src/screen_search.c
+++ b/src/screen_search.c
@@ -382,10 +382,10 @@ static void
paint(void)
{
if (browser.filelist) {
- browser.lw->flags = 0;
+ browser.lw->hide_cursor = false;
list_window_paint(browser.lw, browser_lw_callback, browser.filelist);
} else {
- browser.lw->flags = LW_HIDE_CURSOR;
+ browser.lw->hide_cursor = true;
list_window_paint(browser.lw, lw_search_help_callback, NULL);
}
}
diff --git a/src/screen_song.c b/src/screen_song.c
index 2c73ea6f5..4a8f7169f 100644
--- a/src/screen_song.c
+++ b/src/screen_song.c
@@ -78,7 +78,7 @@ screen_song_init(WINDOW *w, int cols, int rows)
{
current.lines = g_ptr_array_new();
lw = list_window_init(w, cols, rows);
- lw->flags = LW_HIDE_CURSOR;
+ lw->hide_cursor = true;
}
static void