Optimization: Get the colorpixels when loading configuration, make use of the new config struct

Instead of building arrays of colorpixels we can simply use a pointer
to a struct Colortriple. Furthermore, by getting the colorpixels when
loading the configuration, we save a lot of function calls in the
main code.
This commit is contained in:
Michael Stapelberg
2009-06-01 15:14:45 +02:00
parent 1fcad44f66
commit 2a67630aa6
5 changed files with 53 additions and 70 deletions

View File

@ -793,9 +793,9 @@ int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *
uint32_t background_color;
/* Distinguish if the window is currently focused… */
if (CUR_CELL->currently_focused == client)
background_color = get_colorpixel(conn, config.client.focused.background);
background_color = config.client.focused.background;
/* …or if it is the focused window in a not focused container */
else background_color = get_colorpixel(conn, config.client.focused_inactive.background);
else background_color = config.client.focused_inactive.background;
/* Set foreground color to current focused color, line width to 2 */
uint32_t values[] = {background_color, 2};