--- rxvt-unicode/src/init.C 2006/01/25 21:03:04 1.156 +++ rxvt-unicode/src/init.C 2006/01/29 20:51:28 1.158 @@ -299,6 +299,15 @@ if (!(display = displays.get (rs[Rs_display_name]))) rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); + xa = display->xa; + +#if ENABLE_FRILLS + if (rs[Rs_depth]) + set (display, strtol (rs[Rs_depth], 0, 0)); + else +#endif + set (display); + extract_resources (); free (r_argv); @@ -316,15 +325,6 @@ } #endif - xa = display->xa; - -#if ENABLE_FRILLS - if (rs[Rs_depth]) - set (display, strtol (rs[Rs_depth], 0, 0)); - else -#endif - set (display); - /* * set any defaults not already set */ @@ -484,7 +484,7 @@ if (val == NULL) #endif /* DISPLAY_IS_IP */ - val = XDisplayString (display->display); + val = XDisplayString (xdisp); if (rs[Rs_display_name] == NULL) rs[Rs_display_name] = val; /* use broken `:0' value */ @@ -739,20 +739,23 @@ * xcol[2] == bot shadow */ xcol[1] = pix_colors[Color_scroll]; - xcol[0].set (this, 65535, 65535, 65535); + xcol[0].set (this, rxvt_rgba (rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC)); - unsigned short pr1, pg1, pb1, pr0, pg0, pb0; + rxvt_rgba c0, c1; - xcol[0].get (this, pr0, pg0, pb0); - xcol[1].get (this, pr1, pg1, pb1); + xcol[0].get (this, c0); + xcol[1].get (this, c1); pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50); /* topShadowColor */ if (!xcol[1].set (this, - min (pr0, max (pr0 / 5, pr1) * 7 / 5), - min (pg0, max (pg0 / 5, pg1) * 7 / 5), - min (pb0, max (pb0 / 5, pb1) * 7 / 5))) + rxvt_rgba ( + min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), + min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), + min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), + c1.a) // pa1 vs. pa0: arbitrary + )); xcol[1] = pix_colors[Color_White]; pix_colors[Color_topShadow] = xcol[1]; @@ -806,7 +809,7 @@ && strcasecmp (rsmod, "mod1") >= 0 && strcasecmp (rsmod, "mod5") <= 0) requestedmeta = rsmod[3] - '0'; - map = XGetModifierMapping (display->display); + map = XGetModifierMapping (xdisp); kc = map->modifiermap; for (i = 1; i < 6; i++) @@ -818,7 +821,7 @@ if (kc[k] == 0) break; - switch (XKeycodeToKeysym (display->display, kc[k], 0)) + switch (XKeycodeToKeysym (xdisp, kc[k], 0)) { case XK_Num_Lock: ModNumLockMask = modmasks[i - 1]; @@ -902,7 +905,7 @@ if (XInternAtom (xdisp, "_MOTIF_WM_INFO", True) == None) { /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ - attributes.override_redirect = TRUE; + attributes.override_redirect = true; mwmhints.flags = 0; } else