*** empty log message ***
authorroot <root>
Wed, 25 Jan 2006 02:42:06 +0000 (02:42 +0000)
committerroot <root>
Wed, 25 Jan 2006 02:42:06 +0000 (02:42 +0000)
Changes
src/command.C
src/init.C
src/main.C
src/rxvt.h
src/rxvttoolkit.C
src/rxvttoolkit.h

diff --git a/Changes b/Changes
index 90279c6d485365377a6ad09d6b65edf7ed467363..a928477472e392750a5f8e8a2b4ba1423a848acc 100644 (file)
--- 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.
 
index a5b468e3627e834a9033bb0bc75f586af04ddd19..6c40518f9cf9b4dd05199333bd5ead7dd7b3e1a7 100644 (file)
@@ -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)
index b9db89db23c083abdc65f5afb43996960e2319de..66e45f83db0f78a9daafade47288cf71d60186c9 100644 (file)
@@ -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];
 
index 048f9ecf24771a4c25f230e789ceff7b94810b66..8c39b0192756998e11d8060e1b5b3b58557ad5e7 100644 (file)
@@ -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]);
 
index 2a171f5b46d26843ebcb3f07c2a0bbc759dde70f..ea3e78f98056f130d8b3568e9024c7c8c8d9d984 100644 (file)
@@ -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,
index 078c422d004a4fef3d66d43f840359de4fc555e5..396174dff28f10f4a6bf396088675577d0c5706b 100644 (file)
 # 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--; )
index 88aa46ef30c2db78cff99a9d75dd09fbbed1fd27..4331d41fd7fa62629f5c1cd6acb6e8ec575e7091 100644 (file)
 
 #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