From: David Hill Date: Sun, 15 Jul 2012 18:00:46 +0000 (-0400) Subject: move some things into setup_globals() X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=9daf16e4b60699b18c80c9cdb4494af10140f840;p=spectrwm.git move some things into setup_globals() --- diff --git a/spectrwm.c b/spectrwm.c index ef46434..829bba0 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -7472,6 +7472,19 @@ setup_globals(void) if ((clock_format = strdup("%a %b %d %R %Z %Y")) == NULL) err(1, "setup_globals: strdup: failed to allocate memory."); + + if ((syms = xcb_key_symbols_alloc(conn)) == NULL) + errx(1, "unable to allocate key symbols"); + + astate = get_atom_from_string("WM_STATE"); + aprot = get_atom_from_string("WM_PROTOCOLS"); + adelete = get_atom_from_string("WM_DELETE_WINDOW"); + takefocus = get_atom_from_string("WM_TAKE_FOCUS"); + a_wmname = get_atom_from_string("WM_NAME"); + a_netwmname = get_atom_from_string("_NET_WM_NAME"); + a_utf8_string = get_atom_from_string("UTF8_STRING"); + a_string = get_atom_from_string("STRING"); + a_swm_iconic = get_atom_from_string("_SWM_ICONIC"); } void @@ -7615,19 +7628,6 @@ main(int argc, char *argv[]) errx(1, "can not get XCB connection"); xfd = xcb_get_file_descriptor(conn); - syms = xcb_key_symbols_alloc(conn); - if (!syms) - errx(1, "unable to allocate key symbols"); - - astate = get_atom_from_string("WM_STATE"); - aprot = get_atom_from_string("WM_PROTOCOLS"); - adelete = get_atom_from_string("WM_DELETE_WINDOW"); - takefocus = get_atom_from_string("WM_TAKE_FOCUS"); - a_wmname = get_atom_from_string("WM_NAME"); - a_netwmname = get_atom_from_string("_NET_WM_NAME"); - a_utf8_string = get_atom_from_string("UTF8_STRING"); - a_string = get_atom_from_string("STRING"); - a_swm_iconic = get_atom_from_string("_SWM_ICONIC"); /* look for local and global conf file */ pwd = getpwuid(getuid());