summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-09 23:01:09 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-09 23:01:09 +0100
commitcf1940f8cba5549e6a2de39029fea48fc6c3ebcc (patch)
treec70d2bef2d28e3fb3344dd28a5f0acbdcb104433 /source
parent25dff63006663c947c17c4edbb85c6a12fcca799 (diff)
Reset theme if parsing fails, so we don't display using 1/2 parsed theme
Diffstat (limited to 'source')
-rw-r--r--source/rofi.c10
-rw-r--r--source/widgets/widget.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/source/rofi.c b/source/rofi.c
index 70319540..9f6f14db 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -979,8 +979,10 @@ int main ( int argc, char *argv[] )
if ( config.theme ) {
TICK_N ( "Parse theme" );
- if ( !rofi_theme_parse_file ( config.theme ) ) {
+ if ( rofi_theme_parse_file ( config.theme ) ) {
// TODO: instantiate fallback theme.?
+ rofi_theme_free ( rofi_theme );
+ rofi_theme = NULL;
}
TICK_N ( "Parsed theme" );
}
@@ -991,9 +993,9 @@ int main ( int argc, char *argv[] )
const char ** theme_str = find_arg_strv ( "-theme-str" );
if ( theme_str ) {
for ( int index = 0; theme_str && theme_str[index]; index++ ) {
- if ( !rofi_theme_parse_string ( theme_str[index] ) ) {
- fprintf ( stderr, "Failed to parse: %s\n", theme_str[index] );
- exit ( EXIT_FAILURE );
+ if ( rofi_theme_parse_string ( theme_str[index] ) ) {
+ rofi_theme_free ( rofi_theme );
+ rofi_theme = NULL;
}
}
g_free ( theme_str );
diff --git a/source/widgets/widget.c b/source/widgets/widget.c
index 14235a28..c3460b06 100644
--- a/source/widgets/widget.c
+++ b/source/widgets/widget.c
@@ -4,7 +4,7 @@
#include "theme.h"
/** Default padding. */
-#define WIDGET_DEFAULT_PADDING 2
+#define WIDGET_DEFAULT_PADDING 0
void widget_init ( widget *widget, const char *name )
{