diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-09-26 18:13:10 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-09-26 18:19:29 +0200 |
commit | 769dab5f66e1a344d22c9a3587f5a56ec4b77c2e (patch) | |
tree | 68ad908f12c3c8acf3f7eb5f17c53db9b63522d5 /source/view.c | |
parent | 5815dc7b75d80dfd9424d39a42758161587e28b2 (diff) |
When view centered, don't change x,y.
Diffstat (limited to 'source/view.c')
-rw-r--r-- | source/view.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/view.c b/source/view.c index 8ecb7583..142a1791 100644 --- a/source/view.c +++ b/source/view.c @@ -189,8 +189,13 @@ static void rofi_view_calculate_window_position ( RofiViewState *state ) return; } - // Default location is center. - state->y = CacheState.mon.y + ( CacheState.mon.h - state->height ) / 2; + + if ( !config.fixed_num_lines && ( config.location == WL_CENTER || config.location == WL_EAST || config.location == WL_WEST )){ + state->y = CacheState.mon.y + CacheState.mon.h /2 - state->top_offset; + }else { + // Default location is center. + state->y = CacheState.mon.y + ( CacheState.mon.h - state->height ) / 2; + } state->x = CacheState.mon.x + ( CacheState.mon.w - state->width ) / 2; // Determine window location switch ( config.location ) @@ -1356,7 +1361,7 @@ static void rofi_view_refilter ( RofiViewState *state ) state->quit = TRUE; } scrollbar_set_max_value ( state->scrollbar, state->filtered_lines ); - if ( current_active_menu && config.fixed_num_lines == FALSE ) { + if ( current_active_menu && config.fixed_num_lines == FALSE && ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) { int columns = config.menu_columns; // Calculate the number or rows. We do this by getting the num_lines rounded up to X columns // (num elements is better name) then dividing by columns. |