diff options
author | Max Kellermann <max@duempel.org> | 2008-09-22 10:04:46 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-22 10:04:46 +0200 |
commit | e6d6231b4de336f60bc5b07331e2f1f01096c66c (patch) | |
tree | ca99bb77e967d794af8b88aebd3fdf9c50dc474b /src/screen.c | |
parent | 07632841df4ff1d8fcfac33bd93e06ee43a4498e (diff) | |
download | mpd-e6d6231b4de336f60bc5b07331e2f1f01096c66c.tar.gz mpd-e6d6231b4de336f60bc5b07331e2f1f01096c66c.tar.xz mpd-e6d6231b4de336f60bc5b07331e2f1f01096c66c.zip |
screen: moved list_window mouse code to list_window.c
Move the portion of screen_get_mouse_event() which handles list_window
clicks to list_window.c. The code contained a NULL pointer
dereference, which is now fixed.
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/screen.c b/src/screen.c index 92ce29e48..a76438b9c 100644 --- a/src/screen.c +++ b/src/screen.c @@ -737,9 +737,7 @@ screen_idle(mpdclient_t *c) #ifdef HAVE_GETMOUSE int -screen_get_mouse_event(mpdclient_t *c, - list_window_t *lw, int lw_length, - unsigned long *bstate, int *row) +screen_get_mouse_event(mpdclient_t *c, unsigned long *bstate, int *row) { MEVENT event; @@ -756,24 +754,6 @@ screen_get_mouse_event(mpdclient_t *c, return 1; } - /* if the even occured above the list window move up */ - if (*row < 0 && lw) { - if (event.bstate & BUTTON3_CLICKED) - list_window_first(lw); - else - list_window_previous_page(lw); - return 1; - } - - /* if the even occured below the list window move down */ - if ((unsigned)*row >= lw->rows && lw) { - if (event.bstate & BUTTON3_CLICKED) - list_window_last(lw, lw_length); - else - list_window_next_page(lw, lw_length); - return 1; - } - return 0; } #endif |