Merge remote-tracking branch 'origin/master' into nolayercake

This commit is contained in:
Dave Davenport 2017-02-01 21:18:14 +01:00
commit d76dc8ee51
4 changed files with 25 additions and 12 deletions

View File

@ -650,6 +650,12 @@ Force rofi mode to first read all data from stdin before showing selection windo
Note: the default asynchronous mode will also be automatically disabled if used with conflicting options
such as `-dump`, `-only-match` or `-auto-select`
`-async-pre-read` *number*
Reads the first 25 entries blocking. Then switches to async mode. This makes it feel more 'snappy'.
*default*: 25
### Message dialog
`-e` *message*

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ROFI\-MANPAGE" "" "January 2017" "" ""
.TH "ROFI\-MANPAGE" "" "February 2017" "" ""
.
.SH "NAME"
\fBrofi\fR \- A window switcher, run launcher, ssh dialog and dmenu replacement
@ -1007,6 +1007,15 @@ Force rofi mode to first read all data from stdin before showing selection windo
.P
Note: the default asynchronous mode will also be automatically disabled if used with conflicting options such as \fB\-dump\fR, \fB\-only\-match\fR or \fB\-auto\-select\fR
.
.P
\fB\-async\-pre\-read\fR \fInumber\fR
.
.P
Reads the first 25 entries blocking\. Then switches to async mode\. This makes it feel more \'snappy\'\.
.
.P
\fIdefault\fR: 25
.
.SS "Message dialog"
\fB\-e\fR \fImessage\fR
.

View File

@ -635,7 +635,7 @@ int dmenu_switcher_dialog ( void )
async = FALSE;
}
if ( async ) {
unsigned int pre_read = 0;
unsigned int pre_read = 25;
find_arg_uint("-async-pre-read", &pre_read);
async = get_dmenu_async ( pd, pre_read );
}
@ -728,4 +728,5 @@ void print_dmenu_options ( void )
print_help_msg ( "-sep", "[char]", "Element separator.", "'\\n'", is_term );
print_help_msg ( "-input", "[filename]", "Read input from file instead from standard input.", NULL, is_term );
print_help_msg ( "-sync", "", "Force dmenu to first read all input data, then show dialog.", NULL, is_term );
print_help_msg ( "-async-pre-read", "[number]", "Read several entries blocking before switching to async mode", "25", is_term);
}

View File

@ -1084,16 +1084,13 @@ static void rofi_view_refilter ( RofiViewState *state )
state->retv = MENU_OK;
state->quit = TRUE;
}
// Make sure we enable fixed num lines when in normal window mode.
if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) {
int height = rofi_view_calculate_height ( state );
if ( height != state->height ) {
state->height = height;
rofi_view_calculate_window_position ( state );
rofi_view_window_update_size ( state );
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Resize based on re-filter" );
}
// Size the window.
int height = rofi_view_calculate_height ( state );
if ( height != state->height ) {
state->height = height;
rofi_view_calculate_window_position ( state );
rofi_view_window_update_size ( state );
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Resize based on re-filter" );
}
state->refilter = FALSE;
TICK_N ( "Filter done" );