changeset 5229:110539a25499

(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO. (Fx_create_frame): Add frame to Vframe_list. (Fx_create_frame): Fix order of arguments of x_wm_set_size_hint call. This corrects handling of +x-y and -x+y geometry specifications. (XSetWMProtocols): New function, defined conditionally.
author Richard M. Stallman <rms@gnu.org>
date Thu, 23 Dec 1993 01:00:49 +0000
parents c094c1df2e87
children 8c30e49ddc04
files src/xfns.c
diffstat 1 files changed, 53 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Thu Dec 23 00:57:11 1993 +0000
+++ b/src/xfns.c	Thu Dec 23 01:00:49 1993 +0000
@@ -1529,6 +1529,24 @@
   return window_prompting;
 }
 
+#if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS)
+
+Status
+XSetWMProtocols (dpy, w, protocols, count)
+     Display *dpy;
+     Window w;
+     Atom *protocols;
+     int count;
+{
+  Atom prop;
+  prop = XInternAtom (dpy, "WM_PROTOCOLS", False);
+  if (prop == None) return False;
+  XChangeProperty (dpy, w, prop, XA_ATOM, 32, PropModeReplace,
+		   (unsigned char *) protocols, count);
+  return True;
+}
+#endif /* !HAVE_X11R4 && !HAVE_XSETWMPROTOCOLS */
+
 static void
 x_window (f)
      struct frame *f;
@@ -1865,8 +1883,8 @@
   x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0),
 		       "menuBarLines", "MenuBarLines", number);
 
-  tem0 = x_get_arg (parms, Qtop, 0, 0, number);
-  tem1 = x_get_arg (parms, Qleft, 0, 0, number);
+  tem0 = x_get_arg (parms, Qleft, 0, 0, number);
+  tem1 = x_get_arg (parms, Qtop, 0, 0, number);
   BLOCK_INPUT;
   x_wm_set_size_hint (f, window_prompting, XINT (tem0), XINT (tem1));
   UNBLOCK_INPUT;
@@ -1891,6 +1909,7 @@
       ;
   }
 
+  Vframe_list = Fcons (frame, Vframe_list);
   return frame;
 #else /* X10 */
   struct frame *f;
@@ -2129,6 +2148,7 @@
 
   SET_FRAME_GARBAGED (f);
 
+  Vframe_list = Fcons (frame, Vframe_list);
   return frame;
 #endif /* X10 */
 }
@@ -2293,11 +2313,20 @@
     }
 
   BLOCK_INPUT;
+
+  /* Solaris 2.3 has a bug in XListFontsWithInfo.  */
+#ifdef BROKEN_XLISTFONTSWITHINFO
+  names = XListFonts (x_current_display,
+                      XSTRING (pattern)->data,
+                      2000, /* maxnames */
+                      &num_fonts); /* count_return */
+#else
   names = XListFontsWithInfo (x_current_display,
 			      XSTRING (pattern)->data,
 			      2000, /* maxnames */
 			      &num_fonts, /* count_return */
 			      &info); /* info_return */
+#endif
   UNBLOCK_INPUT;
 
   list = Qnil;
@@ -2307,16 +2336,30 @@
       Lisp_Object *tail;
       int i;
 
-      tail = &list;
       for (i = 0; i < num_fonts; i++)
-	if (! size_ref 
-	    || same_size_fonts (&info[i], size_ref))
-	  {
-	    *tail = Fcons (build_string (names[i]), Qnil);
-	    tail = &XCONS (*tail)->cdr;
-	  }
-
+        {
+#ifdef BROKEN_XLISTFONTSWITHINFO
+          BLOCK_INPUT;
+          info = XLoadQueryFont (x_current_display, names[i]);
+          UNBLOCK_INPUT;
+#else
+	  info = &info[i];
+#endif
+          if (info && (! size_ref
+		       || same_size_fonts (info, size_ref)))
+	    {
+	      *tail = Fcons (build_string (names[i]), Qnil);
+	      tail = &XCONS (*tail)->cdr;
+	    }
+        }
+
+      BLOCK_INPUT;
+#ifdef BROKEN_XLISTFONTSWITHINFO
+      XFreeFontNames (names);
+#else
       XFreeFontInfo (names, info, num_fonts);
+#endif
+      UNBLOCK_INPUT;
     }
 
   return list;