From 74173312918209fce4bb4b965eb1c8ebee33a33c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Jan 2006 02:42:06 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 2 ++ src/command.C | 10 ---------- src/init.C | 9 +++------ src/main.C | 10 ++++++++++ src/rxvt.h | 38 +------------------------------------ src/rxvttoolkit.C | 48 ++++++++++++++++++++++++++++++++++++++++++----- src/rxvttoolkit.h | 40 +++++++++++++++++++++++++++++++++++++-- 7 files changed, 97 insertions(+), 60 deletions(-) diff --git a/Changes b/Changes index 90279c6d..a9284774 100644 --- 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 index a5b468e3..6c40518f 100644 --- 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 index b9db89db..66e45f83 100644 --- a/src/init.C +++ b/src/init.C @@ -179,14 +179,11 @@ const char *const def_colorName[] = bool rxvt_term::init_vars () { - pix_colors_focused = new rxvt_color [TOTAL_COLORS]; + pix_colors = // + pix_colors_focused = new rxvt_color [TOTAL_COLORS]; #ifdef OFF_FOCUS_FADING pix_colors_unfocused = new rxvt_color [TOTAL_COLORS]; #endif - pix_colors = pix_colors_focused; - - if (pix_colors == NULL) - return false; #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) pixmap = None; @@ -1040,7 +1037,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) #ifdef XPM_BACKGROUND if (rs[Rs_backgroundPixmap] != NULL - && ! OPTION (Opt_transparent)) + && !OPTION (Opt_transparent)) { const char *p = rs[Rs_backgroundPixmap]; diff --git a/src/main.C b/src/main.C index 048f9ecf..8c39b019 100644 --- 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 index 2a171f5b..ea3e78f9 100644 --- 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 index 078c422d..396174df 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -34,6 +34,44 @@ # include #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 index 88aa46ef..4331d41f 100644 --- 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 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 -- 2.34.1