--- rxvt-unicode/src/init.C 2004/12/11 23:01:36 1.96 +++ rxvt-unicode/src/init.C 2004/12/20 16:44:31 1.99 @@ -35,7 +35,7 @@ #include "rxvt.h" /* NECESSARY */ #include "init.h" -#include +#include const char *const def_colorName[] = { @@ -157,6 +157,9 @@ NULL, /* Color_UL */ NULL, /* Color_RV */ #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ +#if ENABLE_FRILLS + NULL, // Color_underline +#endif #ifdef OPTION_HC NULL, #endif @@ -169,7 +172,7 @@ #endif }; -const char *const xa_names[NUM_XA] = +const char *const xa_names[] = { "TEXT", "COMPOUND_TEXT", @@ -180,14 +183,24 @@ "VT_SELECTION", "INCR", "WM_DELETE_WINDOW", + "CLIPBOARD", +#if ENABLE_FRILLS + "_NET_WM_PID", + "_MOTIF_WM_HINTS", + "_NET_WM_NAME", + "_NET_WM_ICON_NAME", +#endif +#if USE_XIM + "WM_LOCALE_NAME", +#endif #ifdef TRANSPARENT "_XROOTPMAP_ID", + "ESETROOT_PMAP_ID", #endif #ifdef OFFIX_DND "DndProtocol", "DndSelection", #endif - "CLIPBOARD" }; bool @@ -613,7 +626,7 @@ rxvt_warn ("setting locale failed, working without locale support.\n"); else { - set_string_property (display->atom ("WM_LOCALE_NAME"), locale); + set_string_property (xa[XA_WM_LOCALE_NAME], locale); if (!XSupportsLocale ()) { @@ -898,14 +911,14 @@ XSetWindowAttributes attributes; XWindowAttributes gattr; - for (int i = 0; i < NUM_XA; i++) - xa[i] = XInternAtom (display->display, xa_names[i], False); - #ifdef USING_W11LIB /* enable W11 callbacks */ W11AddEventHandler (display->display, rxvt_W11_process_x_event); #endif + assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); + XInternAtoms (display->display, (char **)xa_names, NUM_XA, False, xa); + if (options & Opt_transparent) { XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr); @@ -991,7 +1004,7 @@ long pid = getpid (); XChangeProperty (display->display, TermWin.parent[0], - display->atom ("_NET_WM_PID"), XA_CARDINAL, 32, + xa[XA_NET_WM_PID], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1); #endif @@ -1007,11 +1020,8 @@ #if ENABLE_FRILLS if (mwmhints.flags) - { - prop = XInternAtom (display->display, "_MOTIF_WM_HINTS", False); - XChangeProperty (display->display, TermWin.parent[0], prop, prop, 32, - PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); - } + XChangeProperty (display->display, TermWin.parent[0], xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, + PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); #endif /* vt cursor: Black-on-White is standard, but this is more popular */