-- 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:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

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

index 90279c6d485365377a6ad09d6b65edf7ed467363..

index ..a928477472e392750a5f8e8a2b4ba1423a848acc 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 a5b468e3627e834a9033bb0bc75f586af04ddd19..

index ..6c40518f9cf9b4dd05199333bd5ead7dd7b3e1a7 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 c78a0c50f07c2b763470cf0efafbc644eb52ec97..

index ..b9db89db23c083abdc65f5afb43996960e2319de 100644

--- 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

index 048f9ecf24771a4c25f230e789ceff7b94810b66..

index ..8c39b0192756998e11d8060e1b5b3b58557ad5e7 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 2a171f5b46d26843ebcb3f07c2a0bbc759dde70f..

index ..ea3e78f98056f130d8b3568e9024c7c8c8d9d984 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 078c422d004a4fef3d66d43f840359de4fc555e5..

index ..396174dff28f10f4a6bf396088675577d0c5706b 100644

--- 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

index 88aa46ef30c2db78cff99a9d75dd09fbbed1fd27..

index ..4331d41fd7fa62629f5c1cd6acb6e8ec575e7091 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<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