-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: dedb0a99719f0fda49c0a0d66a81148ebe8e8898: path_to: revision_to:
commit dedb0a99719f0fda49c0a0d66a81148ebe8e8898 Author: Marc Lehmann <schmorp@schmorp.de> Date: Wed Jan 25 02:42:06 2006 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- a/Changes +++ b/Changes @@ -20,6 +20,8 @@ DUMB: support tex fonts - experimental OnTheSpot editing support (-pe xim-onthespot). - moved Shift-Button2 paste combination to Meta-Button2. - removed (unused) arabic presentation form composing sequences. + - reduced number of server turnarounds at startup by allocating + atoms only once per display. - changed version sos (ESC [ > c) response to be more compatible with xterm. diff --git a/src/command.C b/src/command.C
--- a/src/command.C +++ b/src/command.C @@ -1268,16 +1268,6 @@ rxvt_term::mouse_report (XButtonEvent &ev) (32 + y + 1)); } -#ifdef USING_W11LIB -void -rxvt_W11_process_x_event (XEvent *ev) -{ - rxvt_t *r = rxvt_get_r (); - - x_cb (*ev); -} -#endif - /*{{{ process an X event */ void rxvt_term::x_cb (XEvent &ev) diff --git a/src/init.C b/src/init.C
--- a/src/init.C +++ b/src/init.C @@ -176,41 +176,6 @@ const char *const def_colorName[] = #endif }; -const char *const xa_names[] = - { - "TEXT", - "COMPOUND_TEXT", - "UTF8_STRING", - "MULTIPLE", - "TARGETS", - "TIMESTAMP", - "VT_SELECTION", - "INCR", - "WM_PROTOCOLS", - "WM_DELETE_WINDOW", - "CLIPBOARD", -#if ENABLE_FRILLS - "_MOTIF_WM_HINTS", -#endif -#if ENABLE_EWMH - "_NET_WM_PID", - "_NET_WM_NAME", - "_NET_WM_ICON_NAME", - "_NET_WM_PING", -#endif -#if USE_XIM - "WM_LOCALE_NAME", -#endif -#ifdef TRANSPARENT - "_XROOTPMAP_ID", - "ESETROOT_PMAP_ID", -#endif -#if ENABLE_XEMBED - "_XEMBED", - "_XEMBED_INFO", -#endif - }; - bool rxvt_term::init_vars () { @@ -916,28 +881,14 @@ rxvt_term::create_windows (int argc, const char *const *argv) XClassHint classHint; XWMHints wmHint; #if ENABLE_FRILLS - Atom prop = None; MWMHints mwmhints; #endif XGCValues gcvalue; XSetWindowAttributes attributes; - XWindowAttributes gattr; Window top, parent; dDisp; -#ifdef USING_W11LIB - /* enable W11 callbacks */ - W11AddEventHandler (disp, rxvt_W11_process_x_event); -#endif - - assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); - XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa); - - if (OPTION (Opt_transparent)) - { - XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr); - display->depth = gattr.depth; // doh //TODO, per-term not per-display? - } + xa = display->xa; /* grab colors before netscape does */ Get_Colours (); @@ -945,16 +896,14 @@ rxvt_term::create_windows (int argc, const char *const *argv) if (!set_fonts ()) rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); - parent = DefaultRootWindow (disp); + parent = display->root; attributes.override_redirect = !!OPTION (Opt_override_redirect); #if ENABLE_FRILLS if (OPTION (Opt_borderLess)) { - prop = XInternAtom (disp, "_MOTIF_WM_INFO", True); - - if (prop == None) + if (XInternAtom (disp, "_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; @@ -988,8 +937,9 @@ rxvt_term::create_windows (int argc, const char *const *argv) /* sub-window placement & size in rxvt_resize_subwindows () */ attributes.background_pixel = pix_colors_focused[Color_border]; - attributes.border_pixel = pix_colors_focused[Color_border]; - attributes.colormap = display->cmap; + attributes.border_pixel = pix_colors_focused[Color_border]; + attributes.colormap = display->cmap; + top = XCreateWindow (disp, parent, szHint.x, szHint.y, szHint.width, szHint.height, @@ -1004,20 +954,26 @@ rxvt_term::create_windows (int argc, const char *const *argv) old_width = szHint.width; old_height = szHint.height; - process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); + process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); - classHint.res_name = (char *)rs[Rs_name]; + classHint.res_name = (char *)rs[Rs_name]; classHint.res_class = (char *)RESCLASS; - wmHint.flags = InputHint | StateHint | WindowGroupHint; - wmHint.input = True; + wmHint.flags = InputHint | StateHint | WindowGroupHint; + wmHint.input = True; wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState; - wmHint.window_group = top; + wmHint.window_group = top; XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, &szHint, &wmHint, &classHint); +#if ENABLE_FRILLS + if (mwmhints.flags) + XChangeProperty (disp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, + PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); +#endif + Atom protocols[] = { xa[XA_WM_DELETE_WINDOW], #if ENABLE_EWMH @@ -1052,12 +1008,6 @@ rxvt_term::create_windows (int argc, const char *const *argv) termwin_ev.start (display, top); -#if ENABLE_FRILLS - if (mwmhints.flags) - XChangeProperty (disp, top, 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 */ TermWin_cursor = XCreateFontCursor (disp, XC_xterm); @@ -1068,16 +1018,11 @@ rxvt_term::create_windows (int argc, const char *const *argv) /* the vt window */ vt = XCreateSimpleWindow (disp, top, - window_vt_x, - window_vt_y, - width, - height, - 0, - pix_colors_focused[Color_fg], - pix_colors_focused[Color_bg]); -#ifdef DEBUG_X - XStoreName (disp, vt, "vt window"); -#endif + window_vt_x, window_vt_y, + width, height, + 0, + pix_colors_focused[Color_fg], + pix_colors_focused[Color_bg]); attributes.bit_gravity = NorthWestGravity; XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); @@ -1111,12 +1056,13 @@ rxvt_term::create_windows (int argc, const char *const *argv) #endif /* graphics context for the vt window */ - gcvalue.foreground = pix_colors[Color_fg]; - gcvalue.background = pix_colors[Color_bg]; + gcvalue.foreground = pix_colors[Color_fg]; + gcvalue.background = pix_colors[Color_bg]; gcvalue.graphics_exposures = 1; + gc = XCreateGC (disp, vt, - GCForeground | GCBackground | GCGraphicsExposures, - &gcvalue); + GCForeground | GCBackground | GCGraphicsExposures, + &gcvalue); drawable = new rxvt_drawable (display, vt); @@ -1137,16 +1083,6 @@ rxvt_term::create_windows (int argc, const char *const *argv) pointer_unblank (); scr_recolour (); - -#if ENABLE_XEMBED - if (rs[Rs_embed]) - { - long info[2] = { 0, XEMBED_MAPPED }; - - XChangeProperty (disp, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], - 32, PropModeReplace, (unsigned char *)&info, 2); - } -#endif } /* ------------------------------------------------------------------------- * diff --git a/src/main.C b/src/main.C
--- a/src/main.C +++ b/src/main.C @@ -515,6 +515,16 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv) HOOK_INVOKE ((this, HOOK_START, DT_END)); +#if ENABLE_XEMBED + if (rs[Rs_embed]) + { + long info[2] = { 0, XEMBED_MAPPED }; + + XChangeProperty (display->display, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], + 32, PropModeReplace, (unsigned char *)&info, 2); + } +#endif + XMapWindow (disp, vt); XMapWindow (disp, parent[0]); diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h +++ b/src/rxvt.h @@ -621,42 +621,6 @@ enum { NUM_RESOURCES }; -// see init.C:xa_names, which must be kept in sync -enum { - XA_TEXT = 0, - XA_COMPOUND_TEXT, - XA_UTF8_STRING, - XA_MULTIPLE, - XA_TARGETS, - XA_TIMESTAMP, - XA_VT_SELECTION, - XA_INCR, - XA_WM_PROTOCOLS, - XA_WM_DELETE_WINDOW, - XA_CLIPBOARD, -#if ENABLE_FRILLS - XA_MOTIF_WM_HINTS, -#endif -#if ENABLE_EWMH - XA_NET_WM_PID, - XA_NET_WM_NAME, - XA_NET_WM_ICON_NAME, - XA_NET_WM_PING, -#endif -#if USE_XIM - XA_WM_LOCALE_NAME, -#endif -#if TRANSPARENT - XA_XROOTPMAP_ID, - XA_ESETROOT_PMAP_ID, -#endif -#if ENABLE_XEMBED - XA_XEMBED, - XA_XEMBED_INFO, -#endif - NUM_XA -}; - /* DEC private modes */ #define PrivMode_132 (1UL<<0) #define PrivMode_132OK (1UL<<1) @@ -1037,7 +1001,7 @@ struct rxvt_term : zero_initialized, rxvt_vars { unsigned long priv_modes, SavedModes; /* ---------- */ - Atom xa[NUM_XA]; + Atom *xa; /* ---------- */ #ifdef RXVT_SCROLLBAR GC scrollbarGC, diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C
--- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -34,6 +34,44 @@ # include <sys/un.h> #endif +const char *const xa_names[] = + { + "TEXT", + "COMPOUND_TEXT", + "UTF8_STRING", + "MULTIPLE", + "TARGETS", + "TIMESTAMP", + "VT_SELECTION", + "INCR", + "WM_PROTOCOLS", + "WM_DELETE_WINDOW", + "CLIPBOARD", +#if ENABLE_FRILLS + "_MOTIF_WM_HINTS", +#endif +#if ENABLE_EWMH + "_NET_WM_PID", + "_NET_WM_NAME", + "_NET_WM_ICON_NAME", + "_NET_WM_PING", +#endif +#if USE_XIM + "WM_LOCALE_NAME", + "XIM_SERVERS", +#endif +#ifdef TRANSPARENT + "_XROOTPMAP_ID", + "ESETROOT_PMAP_ID", +#endif +#if ENABLE_XEMBED + "_XEMBED", + "_XEMBED_INFO", +#endif + }; + +///////////////////////////////////////////////////////////////////////////// + refcounted::refcounted (const char *id) { this->id = strdup (id); @@ -255,6 +293,9 @@ bool rxvt_display::ref_init () cmap = DefaultColormap (display, screen); depth = DefaultDepth (display, screen); + assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); + XInternAtoms (display, (char **)xa_names, NUM_XA, False, xa); + XrmSetDatabase (display, get_resources ()); #ifdef POINTER_BLANK @@ -305,9 +346,6 @@ bool rxvt_display::ref_init () fcntl (fd, F_SETFD, FD_CLOEXEC); XSelectInput (display, root, PropertyChangeMask); -#ifdef USE_XIM - xa_xim_servers = XInternAtom (display, "XIM_SERVERS", 0); -#endif flush (); @@ -353,7 +391,7 @@ void rxvt_display::im_change_check () int actual_format; unsigned long nitems, bytes_after; - if (XGetWindowProperty (display, root, xa_xim_servers, 0L, 1000000L, + if (XGetWindowProperty (display, root, xa[XA_XIM_SERVERS], 0L, 1000000L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytes_after, (unsigned char **)&atoms) != Success ) @@ -383,7 +421,7 @@ void rxvt_display::x_cb (io_watcher &w, short revents) { if (xev.type == PropertyNotify && xev.xany.window == root - && xev.xproperty.atom == xa_xim_servers) + && xev.xproperty.atom == xa[XA_XIM_SERVERS]) im_change_check (); #endif for (int i = xw.size (); i--; ) diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h
--- a/src/rxvttoolkit.h +++ b/src/rxvttoolkit.h @@ -17,6 +17,43 @@ #include "callback.h" +// see rxvttoolkit.C:xa_names, which must be kept in sync +enum { + XA_TEXT, + XA_COMPOUND_TEXT, + XA_UTF8_STRING, + XA_MULTIPLE, + XA_TARGETS, + XA_TIMESTAMP, + XA_VT_SELECTION, + XA_INCR, + XA_WM_PROTOCOLS, + XA_WM_DELETE_WINDOW, + XA_CLIPBOARD, +#if ENABLE_FRILLS + XA_MOTIF_WM_HINTS, +#endif +#if ENABLE_EWMH + XA_NET_WM_PID, + XA_NET_WM_NAME, + XA_NET_WM_ICON_NAME, + XA_NET_WM_PING, +#endif +#if USE_XIM + XA_WM_LOCALE_NAME, + XA_XIM_SERVERS, +#endif +#if TRANSPARENT + XA_XROOTPMAP_ID, + XA_ESETROOT_PMAP_ID, +#endif +#if ENABLE_XEMBED + XA_XEMBED, + XA_XEMBED_INFO, +#endif + NUM_XA +}; + struct rxvt_term; struct rxvt_display; @@ -62,8 +99,6 @@ struct rxvt_xim : refcounted { #endif struct rxvt_display : refcounted { - Atom xa_xim_servers; - io_manager_vec<xevent_watcher> xw; io_watcher x_ev; void x_cb (io_watcher &w, short revents); @@ -84,6 +119,7 @@ struct rxvt_display : refcounted { Colormap cmap; Window root; rxvt_term *selection_owner; + Atom xa[NUM_XA]; #ifndef NO_SLOW_LINK_SUPPORT bool is_local; #endif
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 09:23:00 2024