mirror of https://github.com/davatorium/rofi.git
Some cleanups
This commit is contained in:
parent
e72da1bde5
commit
683632c36c
|
@ -574,10 +574,11 @@ void config_sanity_check ( Display *display )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( config.fullscreen && config.monitor != -1 ) {
|
if ( config.fullscreen && config.monitor != -1 ) {
|
||||||
g_string_append_printf ( msg, "\t<b>config.monitor</b>=%d is invalid. Value should be unset (-1) when fullscreen mode is enabled.\n",
|
g_string_append_printf ( msg,
|
||||||
config.monitor);
|
"\t<b>config.monitor</b>=%d is invalid. Value should be unset (-1) when fullscreen mode is enabled.\n",
|
||||||
|
config.monitor );
|
||||||
config.monitor = -1;
|
config.monitor = -1;
|
||||||
found_error = 1;
|
found_error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check size
|
// Check size
|
||||||
|
|
|
@ -1440,7 +1440,7 @@ void error_dialog ( const char *msg, int markup )
|
||||||
menu_calculate_window_and_element_width ( &state, &mon );
|
menu_calculate_window_and_element_width ( &state, &mon );
|
||||||
state.max_elements = 0;
|
state.max_elements = 0;
|
||||||
|
|
||||||
state.text = textbox_create ( TB_AUTOHEIGHT | TB_WRAP + ( ( markup ) ? TB_MARKUP : 0 ),
|
state.text = textbox_create ( ( TB_AUTOHEIGHT | TB_WRAP ) + ( ( markup ) ? TB_MARKUP : 0 ),
|
||||||
( state.border ), ( state.border ),
|
( state.border ), ( state.border ),
|
||||||
( state.w - ( 2 * ( state.border ) ) ), 1, NORMAL, ( msg != NULL ) ? msg : "" );
|
( state.w - ( 2 * ( state.border ) ) ), 1, NORMAL, ( msg != NULL ) ? msg : "" );
|
||||||
state.line_height = textbox_get_height ( state.text );
|
state.line_height = textbox_get_height ( state.text );
|
||||||
|
@ -1889,6 +1889,7 @@ static gpointer rofi_signal_handler_process ( gpointer arg )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,21 +64,21 @@ void scrollbar_free ( scrollbar *sb )
|
||||||
void scrollbar_set_max_value ( scrollbar *sb, unsigned int max )
|
void scrollbar_set_max_value ( scrollbar *sb, unsigned int max )
|
||||||
{
|
{
|
||||||
if ( sb != NULL ) {
|
if ( sb != NULL ) {
|
||||||
sb->length = MAX ( 1, max );
|
sb->length = MAX ( 1u, max );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scrollbar_set_handle ( scrollbar *sb, unsigned int pos )
|
void scrollbar_set_handle ( scrollbar *sb, unsigned int pos )
|
||||||
{
|
{
|
||||||
if ( sb != NULL ) {
|
if ( sb != NULL ) {
|
||||||
sb->pos = MIN ( sb->length, MAX ( 0, pos ) );
|
sb->pos = MIN ( sb->length, pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scrollbar_set_handle_length ( scrollbar *sb, unsigned int pos_length )
|
void scrollbar_set_handle_length ( scrollbar *sb, unsigned int pos_length )
|
||||||
{
|
{
|
||||||
if ( sb != NULL ) {
|
if ( sb != NULL ) {
|
||||||
sb->pos_length = MIN ( sb->length, MAX ( 1, pos_length ) );
|
sb->pos_length = MIN ( sb->length, MAX ( 1u, pos_length ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -590,7 +590,7 @@ static void textbox_parse_string ( Display *display, const char *str, RowColor
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char *cstr = g_strdup ( str );
|
char *cstr = g_strdup ( str );
|
||||||
char *endp;
|
char *endp = NULL;
|
||||||
char *token;
|
char *token;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for ( token = strtok_r ( cstr, ",", &endp ); token != NULL; token = strtok_r ( NULL, ",", &endp ) ) {
|
for ( token = strtok_r ( cstr, ",", &endp ); token != NULL; token = strtok_r ( NULL, ",", &endp ) ) {
|
||||||
|
|
|
@ -22,11 +22,13 @@ int show_error_message ( const char *msg, int markup )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#include <x11-helper.h>
|
#include <x11-helper.h>
|
||||||
int monitor_get_smallest_size ( Display *d )
|
int monitor_get_smallest_size ( G_GNUC_UNUSED Display *d )
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
int monitor_get_dimension ( Display *d, Screen *screen, int monitor, workarea *mon )
|
int monitor_get_dimension ( G_GNUC_UNUSED Display *d, G_GNUC_UNUSED Screen *screen, G_GNUC_UNUSED int monitor, G_GNUC_UNUSED workarea *mon )
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main ( int argc, char ** argv )
|
int main ( int argc, char ** argv )
|
||||||
|
|
Loading…
Reference in New Issue