summaryrefslogtreecommitdiffstats
path: root/source/view.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-12-29 21:58:32 +0100
committerDave Davenport <qball@gmpclient.org>2016-12-29 21:58:32 +0100
commitb0a8edc95a5698c1d3c8b1751c6c65470c94fd4b (patch)
treee06ffc691536fe0ffbdb95909344c59777fb2055 /source/view.c
parent5183c14b51d7fa1c2abeb58615e99df5d7fb1bb1 (diff)
Fix resizing normal-window mode.
Diffstat (limited to 'source/view.c')
-rw-r--r--source/view.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/view.c b/source/view.c
index bd8c4f2e..476c7fa4 100644
--- a/source/view.c
+++ b/source/view.c
@@ -298,7 +298,7 @@ static void rofi_view_window_update_size ( RofiViewState * state )
CacheState.edit_draw = cairo_create ( CacheState.edit_surf );
// Should wrap main window in a widget.
- widget_resize ( WIDGET ( state->main_window ), state->width, state->height );
+ widget_resize ( WIDGET ( state->main_window ), state->width, state->height );
}
static gboolean rofi_view_reload_idle ( G_GNUC_UNUSED gpointer data )
@@ -1257,7 +1257,7 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_st
CacheState.edit_surf = cairo_xcb_surface_create ( xcb->connection, CacheState.edit_pixmap, visual, state->width, state->height );
CacheState.edit_draw = cairo_create ( CacheState.edit_surf );
- widget_resize ( WIDGET ( state->main_window ), state->width, state->height );
+ widget_resize ( WIDGET ( state->main_window ), state->width, state->height );
}
}
break;
@@ -1523,6 +1523,10 @@ RofiViewState *rofi_view_create ( Mode *sw,
state->line_map = g_malloc0_n ( state->num_lines, sizeof ( unsigned int ) );
state->distance = (int *) g_malloc0_n ( state->num_lines, sizeof ( int ) );
+ // Make sure we enable fixed num lines when in normal window mode.
+ if ( (CacheState.flags&MENU_NORMAL_WINDOW) == MENU_NORMAL_WINDOW){
+ config.fixed_num_lines = TRUE;
+ }
state->height = rofi_view_calculate_height ( state );
// Move the window to the correct x,y position.
@@ -1565,8 +1569,12 @@ int rofi_view_error_dialog ( const char *msg, int markup )
box_add ( state->main_box, WIDGET ( state->text ), TRUE, FALSE );
unsigned int line_height = textbox_get_height ( state->text );
+ // Make sure we enable fixed num lines when in normal window mode.
+ if ( (CacheState.flags&MENU_NORMAL_WINDOW) == MENU_NORMAL_WINDOW){
+ config.fixed_num_lines = TRUE;
+ }
// resize window vertically to suit
- state->height = line_height + ( state->border ) * 2+state->pad.top+state->pad.bottom;
+ state->height = line_height + window_get_border_width ( state->main_window)+widget_padding_get_padding_height ( WIDGET(state->main_window) );
// Calculte window position.
rofi_view_calculate_window_position ( state );