From 02ef657c4169db062ddf832cb9a296be7c1281f8 Mon Sep 17 00:00:00 2001 From: QC Date: Sun, 24 Aug 2014 11:24:35 +0200 Subject: [PATCH] [Click to select] Only select visible boxes. --- source/rofi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/rofi.c b/source/rofi.c index 153541b0..cca21964 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1279,6 +1279,11 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom else { for ( int i = 0; i < max_elements; i++ ) { if ( ( xbe->window ) == ( boxes[i]->window ) ) { + // Only allow items that are visible to be selected. + if ( ( last_offset + i ) < 0 || ( last_offset + i ) >= filtered_lines ) { + continue; + } + // selected = last_offset + i; update = TRUE; if ( ( xbe->time - last_press ) < 200 ) {