--- rxvt-unicode/src/rxvtcolor.C 2004/02/21 20:33:40 1.8 +++ rxvt-unicode/src/rxvtcolor.C 2004/03/30 14:45:13 1.11 @@ -5,6 +5,23 @@ #include #include +class byteorder byteorder; + +byteorder::byteorder () +{ + union { + uint32_t u; + uint8_t b[4]; + } w; + + w.b[0] = 0x11; + w.b[1] = 0x22; + w.b[2] = 0x33; + w.b[3] = 0x44; + + e = w.u; +} + refcounted::refcounted (const char *id) { this->id = STRDUP (id); @@ -113,6 +130,9 @@ { display = XOpenDisplay (id); + if (!display) + return false; + screen = DefaultScreen (display); root = DefaultRootWindow (display); visual = DefaultVisual (display, screen); @@ -154,7 +174,8 @@ { x_ev.stop (); - XCloseDisplay (display); + if (display) + XCloseDisplay (display); } void rxvt_display::im_change_cb () @@ -253,6 +274,11 @@ xims.put (xim); } +Atom rxvt_display::atom (const char *name) +{ + return XInternAtom (display, name, False); +} + ///////////////////////////////////////////////////////////////////////////// template refcache;