diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-01-04 07:59:30 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-01-04 07:59:30 +0100 |
commit | 41bd981b3804bc2f596973baad506c6f81906f5b (patch) | |
tree | e634574f99e5de8c6f3f3eb45a0a2502231e69c4 | |
parent | c85f1cb0bff11f52e821e54974e06a04f932106f (diff) |
Initialize Xrm only once.
-rw-r--r-- | Changelog | 4 | ||||
-rw-r--r-- | include/textbox.h | 16 | ||||
-rw-r--r-- | include/xrmoptions.h | 4 | ||||
-rw-r--r-- | source/rofi.c | 4 | ||||
-rw-r--r-- | source/xrmoptions.c | 9 |
5 files changed, 25 insertions, 12 deletions
@@ -3,6 +3,10 @@ - Have separate config file. Bug fixes: - Fix subpixel rendering. (#303) + - Fix basic tests on OpenBSD (#272) + - Fix wong use of memcpy. + - Work around for sigwaitinfo on OpenBSD. + 0.15.12: New features: - Initial `-dump` command for dmenu mode. (#216) diff --git a/include/textbox.h b/include/textbox.h index e7aef209..2aa7c4f8 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -32,14 +32,14 @@ typedef struct typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, - TB_MARKUP = 1 << 20, - TB_WRAP = 1 << 21, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, + TB_MARKUP = 1 << 20, + TB_WRAP = 1 << 21, } TextboxFlags; typedef enum diff --git a/include/xrmoptions.h b/include/xrmoptions.h index ab621cae..0d4ffdac 100644 --- a/include/xrmoptions.h +++ b/include/xrmoptions.h @@ -39,6 +39,10 @@ void config_parse_xresource_options_dynamic ( Display *display ); void config_parse_xresource_options_dynamic_file ( const char *filename ); /** + * Initializes the Xresourced system. + */ +void config_parse_xresource_init ( void ); +/** * Free any allocated memory. */ void config_xresource_free ( void ); diff --git a/source/rofi.c b/source/rofi.c index b830114a..0714b1cd 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -2473,6 +2473,10 @@ int main ( int argc, char *argv[] ) sncontext = sn_launchee_context_new_from_environment ( sndisplay, DefaultScreen ( display ) ); } TICK_N ( "Startup Notification" ); + + // Initialize Xresources subsystem. + config_parse_xresource_init (); + TICK_N ( "Initialize Xresources system" ); // Setup keybinding setup_abe (); TICK_N ( "Setup abe" ); diff --git a/source/xrmoptions.c b/source/xrmoptions.c index d81053a2..f09b61b9 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -221,7 +221,6 @@ void config_parse_xresource_options ( Display *display ) { char *xRMS; // Map Xresource entries to rofi config options. - XrmInitialize (); xRMS = XResourceManagerString ( display ); if ( xRMS == NULL ) { @@ -237,7 +236,6 @@ void config_parse_xresource_options_file ( const char *filename ) return; } // Map Xresource entries to rofi config options. - XrmInitialize (); XrmDatabase xDB = XrmGetFileDatabase ( filename ); if ( xDB == NULL ) { return; @@ -331,7 +329,6 @@ void config_parse_xresource_options_dynamic ( Display *display ) { char *xRMS; // Map Xresource entries to rofi config options. - XrmInitialize (); xRMS = XResourceManagerString ( display ); if ( xRMS == NULL ) { @@ -347,7 +344,6 @@ void config_parse_xresource_options_dynamic_file ( const char *filename ) return; } // Map Xresource entries to rofi config options. - XrmInitialize (); XrmDatabase xDB = XrmGetFileDatabase ( filename ); if ( xDB == NULL ) { return; @@ -568,3 +564,8 @@ void print_xresources_theme ( void ) } } } + +void config_parse_xresource_init ( void ) +{ + XrmInitialize (); +} |