Improve window dividers code.
[bpt/emacs.git] / src / xfns.c
index fa83b6f..ff492dc 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions for the X window system.
 
-Copyright (C) 1989, 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2014 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -42,8 +42,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "termchar.h"
 #include "font.h"
 
-#ifdef HAVE_X_WINDOWS
-
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -153,7 +151,7 @@ check_x_display_info (Lisp_Object object)
       struct frame *sf = XFRAME (selected_frame);
 
       if (FRAME_X_P (sf) && FRAME_LIVE_P (sf))
-       dpyinfo = FRAME_X_DISPLAY_INFO (sf);
+       dpyinfo = FRAME_DISPLAY_INFO (sf);
       else if (x_display_list != 0)
        dpyinfo = x_display_list;
       else
@@ -173,7 +171,7 @@ check_x_display_info (Lisp_Object object)
   else
     {
       struct frame *f = decode_window_system_frame (object);
-      dpyinfo = FRAME_X_DISPLAY_INFO (f);
+      dpyinfo = FRAME_DISPLAY_INFO (f);
     }
 
   return dpyinfo;
@@ -193,7 +191,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
   Atom actual_type;
   unsigned long actual_size, bytes_remaining;
   int rc, actual_format;
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   long max_len = 400;
   Display *dpy = FRAME_X_DISPLAY (f);
   unsigned char *tmp_data = NULL;
@@ -256,7 +254,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
       XTranslateCoordinates (FRAME_X_DISPLAY (f),
 
                             /* From-window, to-window.  */
-                            FRAME_X_DISPLAY_INFO (f)->root_window,
+                            FRAME_DISPLAY_INFO (f)->root_window,
                              FRAME_X_WINDOW (f),
 
                             /* From-position, to-position.  */
@@ -275,7 +273,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
           XTranslateCoordinates (FRAME_X_DISPLAY (f),
 
                                  /* From-window, to-window.  */
-                                 FRAME_X_DISPLAY_INFO (f)->root_window,
+                                 FRAME_DISPLAY_INFO (f)->root_window,
                                  FRAME_OUTER_WINDOW (f),
 
                                  /* From-position, to-position.  */
@@ -396,7 +394,7 @@ x_decode_color (struct frame *f, Lisp_Object color_name, int mono_color)
 #endif
 
   /* Return MONO_COLOR for monochrome frames.  */
-  if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
+  if (FRAME_DISPLAY_INFO (f)->n_planes == 1)
     return mono_color;
 
   /* x_defined_color is responsible for coping with failures
@@ -589,7 +587,7 @@ make_invisible_cursor (struct frame *f)
   Cursor c = 0;
 
   x_catch_errors (dpy);
-  pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window,
+  pix = XCreateBitmapFromData (dpy, FRAME_DISPLAY_INFO (f)->root_window,
                                no_data, 1, 1);
   if (! x_had_errors_p (dpy) && pix != None)
     {
@@ -614,7 +612,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
   struct x_output *x = f->output_data.x;
   Display *dpy = FRAME_X_DISPLAY (f);
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
-  Cursor hourglass_cursor, horizontal_drag_cursor;
+  Cursor hourglass_cursor, horizontal_drag_cursor, vertical_drag_cursor;
   unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
   unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
 
@@ -682,7 +680,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 
   if (!NILP (Vx_window_horizontal_drag_shape))
     {
-      CHECK_NUMBER (Vx_window_horizontal_drag_shape);
+      CHECK_TYPE_RANGED_INTEGER (unsigned, Vx_window_horizontal_drag_shape);
       horizontal_drag_cursor
        = XCreateFontCursor (dpy, XINT (Vx_window_horizontal_drag_shape));
     }
@@ -690,6 +688,16 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
     horizontal_drag_cursor
       = XCreateFontCursor (dpy, XC_sb_h_double_arrow);
 
+  if (!NILP (Vx_window_vertical_drag_shape))
+    {
+      CHECK_NUMBER (Vx_window_vertical_drag_shape);
+      vertical_drag_cursor
+       = XCreateFontCursor (dpy, XINT (Vx_window_vertical_drag_shape));
+    }
+  else
+    vertical_drag_cursor
+      = XCreateFontCursor (dpy, XC_sb_v_double_arrow);
+
   /* Check and report errors with the above calls.  */
   x_check_errors (dpy, "can't set cursor shape: %s");
   x_uncatch_errors ();
@@ -714,8 +722,8 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
     XDefineCursor (dpy, FRAME_X_WINDOW (f),
                    f->output_data.x->current_cursor = cursor);
 
-  if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0)
-    FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
+  if (FRAME_DISPLAY_INFO (f)->invisible_cursor == 0)
+    FRAME_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
 
   if (cursor != x->text_cursor
       && x->text_cursor != 0)
@@ -747,6 +755,11 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
     XFreeCursor (dpy, x->horizontal_drag_cursor);
   x->horizontal_drag_cursor = horizontal_drag_cursor;
 
+  if (vertical_drag_cursor != x->vertical_drag_cursor
+      && x->vertical_drag_cursor != 0)
+    XFreeCursor (dpy, x->vertical_drag_cursor);
+  x->vertical_drag_cursor = vertical_drag_cursor;
+
   XFlush (dpy);
   unblock_input ();
 
@@ -961,10 +974,11 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
     nlines = 0;
 
   /* Make sure we redisplay all windows in this frame.  */
-  windows_or_buffers_changed++;
+  windows_or_buffers_changed = 59;
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   FRAME_MENU_BAR_LINES (f) = 0;
+  FRAME_MENU_BAR_HEIGHT (f) = 0;
   if (nlines)
     {
       FRAME_EXTERNAL_MENU_BAR (f) = 1;
@@ -982,7 +996,10 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
     }
 #else /* not USE_X_TOOLKIT && not USE_GTK */
   FRAME_MENU_BAR_LINES (f) = nlines;
-  resize_frame_windows (f, FRAME_LINES (f), 0);
+  FRAME_MENU_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
+  resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
+  if (FRAME_X_WINDOW (f))
+    x_clear_under_internal_border (f);
 
   /* If the menu bar height gets changed, the internal border below
      the top margin has to be cleared.  Also, if the menu bar gets
@@ -995,7 +1012,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
       int y;
 
       /* height can be zero here. */
-      if (height > 0 && width > 0)
+      if (FRAME_X_WINDOW (f) && height > 0 && width > 0)
        {
          y = FRAME_TOP_MARGIN_HEIGHT (f);
 
@@ -1037,7 +1054,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
   int nlines;
 #if ! defined (USE_GTK)
   int delta, root_height;
-  Lisp_Object root_window;
+  int unit = FRAME_LINE_HEIGHT (f);
 #endif
 
   /* Treat tool bars like menu bars.  */
@@ -1053,6 +1070,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 #ifdef USE_GTK
 
   FRAME_TOOL_BAR_LINES (f) = 0;
+  FRAME_TOOL_BAR_HEIGHT (f) = 0;
   if (nlines)
     {
       FRAME_EXTERNAL_TOOL_BAR (f) = 1;
@@ -1070,22 +1088,35 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 
 #else /* !USE_GTK */
 
-     /* Make sure we redisplay all windows in this frame.  */
-  ++windows_or_buffers_changed;
+  /* Make sure we redisplay all windows in this frame.  */
+  windows_or_buffers_changed = 60;
 
-  delta = nlines - FRAME_TOOL_BAR_LINES (f);
+  /* DELTA is in pixels now.  */
+  delta = (nlines - FRAME_TOOL_BAR_LINES (f)) * unit;
 
-  /* Don't resize the tool-bar to more than we have room for.  */
-  root_window = FRAME_ROOT_WINDOW (f);
-  root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
-  if (root_height - delta < 1)
+  /* Don't resize the tool-bar to more than we have room for.  Note: The
+     calculations below and the subsequent call to resize_frame_windows
+     are inherently flawed because they can make the toolbar higher than
+     the containing frame.  */
+  if (delta > 0)
     {
-      delta = root_height - 1;
-      nlines = FRAME_TOOL_BAR_LINES (f) + delta;
+      root_height = WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_ROOT_WINDOW (f)));
+      if (root_height - delta < unit)
+       {
+         delta = root_height - unit;
+         /* When creating a new frame and toolbar mode is enabled, we
+            need at least one toolbar line.  */
+         nlines = max (FRAME_TOOL_BAR_LINES (f) + delta / unit, 1);
+       }
     }
 
   FRAME_TOOL_BAR_LINES (f) = nlines;
-  resize_frame_windows (f, FRAME_LINES (f), 0);
+  FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
+  resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
+#if !defined USE_X_TOOLKIT && !defined USE_GTK
+  if (FRAME_X_WINDOW (f))
+    x_clear_under_internal_border (f);
+#endif
   adjust_frame_glyphs (f);
 
   /* We also have to make sure that the internal border at the top of
@@ -1094,7 +1125,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
      below the tool bar if one is displayed, but is below the menu bar
      if there isn't a tool bar.  The tool bar draws into the area
      below the menu bar.  */
-  if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
+  if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_HEIGHT (f) == 0)
     {
       clear_frame (f);
       clear_current_matrices (f);
@@ -1107,7 +1138,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
     {
       int height = FRAME_INTERNAL_BORDER_WIDTH (f);
       int width = FRAME_PIXEL_WIDTH (f);
-      int y = (FRAME_MENU_BAR_LINES (f) + nlines) * FRAME_LINE_HEIGHT (f);
+      int y = nlines * unit;
 
       /* height can be zero here. */
       if (height > 0 && width > 0)
@@ -1122,7 +1153,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
        clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
     }
 
-    run_window_configuration_change_hook (f);
+  run_window_configuration_change_hook (f);
 #endif /* USE_GTK */
 }
 
@@ -1308,7 +1339,7 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
        text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
                                    &do_free_text_value);
        text.encoding = (stringp ? XA_STRING
-                        : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
+                        : FRAME_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
        text.format = 8;
        text.nitems = bytes;
        if (text.nitems != bytes)
@@ -1325,7 +1356,7 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
            icon.value = x_encode_text (f->icon_name, coding_system, 0,
                                        &bytes, &stringp, &do_free_icon_value);
            icon.encoding = (stringp ? XA_STRING
-                            : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
+                            : FRAME_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
            icon.format = 8;
            icon.nitems = bytes;
            if (icon.nitems != bytes)
@@ -1340,8 +1371,8 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
 #else /* not USE_GTK */
        XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
        XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
-                        FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_name,
-                        FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
+                        FRAME_DISPLAY_INFO (f)->Xatom_net_wm_name,
+                        FRAME_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
                         8, PropModeReplace,
                         SDATA (encoded_name),
                         SBYTES (encoded_name));
@@ -1349,8 +1380,8 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
 
        XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon);
        XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
-                        FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
-                        FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
+                        FRAME_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
+                        FRAME_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
                         8, PropModeReplace,
                         SDATA (encoded_icon_name),
                         SBYTES (encoded_icon_name));
@@ -1385,7 +1416,7 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
       /* If we're switching from explicit to implicit, we had better
         update the mode lines and thereby update the title.  */
       if (f->explicit_name && NILP (name))
-       update_mode_lines = 1;
+       update_mode_lines = 37;
 
       f->explicit_name = ! NILP (name);
     }
@@ -1397,10 +1428,10 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
     {
       /* Check for no change needed in this very common case
         before we do any consing.  */
-      if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name,
+      if (!strcmp (FRAME_DISPLAY_INFO (f)->x_id_name,
                   SSDATA (f->name)))
        return;
-      name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);
+      name = build_string (FRAME_DISPLAY_INFO (f)->x_id_name);
     }
   else
     CHECK_STRING (name);
@@ -1447,7 +1478,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
   if (EQ (name, f->title))
     return;
 
-  update_mode_lines = 1;
+  update_mode_lines = 38;
 
   fset_title (f, name);
 
@@ -1462,7 +1493,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
 void
 x_set_scroll_bar_default_width (struct frame *f)
 {
-  int wid = FRAME_COLUMN_WIDTH (f);
+  int unit = FRAME_COLUMN_WIDTH (f);
 #ifdef USE_TOOLKIT_SCROLL_BARS
 #ifdef USE_GTK
   int minw = xg_get_default_scrollbar_width ();
@@ -1470,17 +1501,14 @@ x_set_scroll_bar_default_width (struct frame *f)
   int minw = 16;
 #endif
   /* A minimum width of 14 doesn't look good for toolkit scroll bars.  */
-  int width = minw + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM;
-  FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid;
-  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width;
+  FRAME_CONFIG_SCROLL_BAR_COLS (f) = (minw + unit - 1) / unit;
+  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = minw;
 #else
-  /* Make the actual width at least 14 pixels and a multiple of a
-     character width.  */
-  FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
-
-  /* Use all of that space (aside from required margins) for the
-     scroll bar.  */
-  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0;
+  /* The width of a non-toolkit scrollbar is at least 14 pixels and a
+     multiple of the frame's character width.  */
+  FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit;
+  FRAME_CONFIG_SCROLL_BAR_WIDTH (f)
+    = FRAME_CONFIG_SCROLL_BAR_COLS (f) * unit;
 #endif
 }
 
@@ -1496,7 +1524,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
                                      const char *xprop, const char *xclass,
                                      int foreground_p)
 {
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   Lisp_Object tem;
 
   tem = x_get_arg (dpyinfo, alist, prop, xprop, xclass, RES_TYPE_STRING);
@@ -1562,7 +1590,7 @@ hack_wm_protocols (struct frame *f, Widget widget)
     unsigned long bytes_after;
 
     if ((XGetWindowProperty (dpy, w,
-                            FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols,
+                            FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
                             (long)0, (long)100, False, XA_ATOM,
                             &type, &format, &nitems, &bytes_after,
                             &catoms)
@@ -1574,13 +1602,13 @@ hack_wm_protocols (struct frame *f, Widget widget)
          {
            nitems--;
            if (atoms[nitems]
-               == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window)
+               == FRAME_DISPLAY_INFO (f)->Xatom_wm_delete_window)
              need_delete = 0;
            else if (atoms[nitems]
-                    == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus)
+                    == FRAME_DISPLAY_INFO (f)->Xatom_wm_take_focus)
              need_focus = 0;
            else if (atoms[nitems]
-                    == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself)
+                    == FRAME_DISPLAY_INFO (f)->Xatom_wm_save_yourself)
              need_save = 0;
          }
       }
@@ -1591,13 +1619,13 @@ hack_wm_protocols (struct frame *f, Widget widget)
     Atom props [10];
     int count = 0;
     if (need_delete)
-      props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window;
+      props[count++] = FRAME_DISPLAY_INFO (f)->Xatom_wm_delete_window;
     if (need_focus)
-      props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus;
+      props[count++] = FRAME_DISPLAY_INFO (f)->Xatom_wm_take_focus;
     if (need_save)
-      props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself;
+      props[count++] = FRAME_DISPLAY_INFO (f)->Xatom_wm_save_yourself;
     if (count)
-      XChangeProperty (dpy, w, FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols,
+      XChangeProperty (dpy, w, FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
                       XA_ATOM, 32, PropModeAppend,
                       (unsigned char *) props, count);
   }
@@ -1753,7 +1781,7 @@ xic_create_fontsetname (const char *base_fontname, int motif)
        }
     }
   if (motif)
-    strcat (fontsetname, ":");
+    return strcat (fontsetname, ":");
   return fontsetname;
 }
 #endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */
@@ -1792,7 +1820,7 @@ xic_create_xfontset (struct frame *f)
       struct frame *cf = XFRAME (frame);
 
       if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
-          && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
+          && FRAME_DISPLAY_INFO (cf) == FRAME_DISPLAY_INFO (f)
          && FRAME_FONT (f)
          && FRAME_FONT (f)->pixel_size == pixel_size)
         {
@@ -1891,7 +1919,7 @@ xic_free_xfontset (struct frame *f)
     {
       struct frame *cf = XFRAME (frame);
       if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
-          && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
+          && FRAME_DISPLAY_INFO (cf) == FRAME_DISPLAY_INFO (f)
           && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f))
         {
           shared_p = 1;
@@ -2136,7 +2164,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
   XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
   XtSetArg (al[ac], XtNborderWidth, f->border_width); ac++;
   XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
-  XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
+  XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++;
   XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
   shell_widget = XtAppCreateShell (f->namebuf, EMACS_CLASS,
                                   applicationShellWidgetClass,
@@ -2151,7 +2179,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
 
   ac = 0;
   XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
-  XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
+  XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++;
   XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
   XtSetArg (al[ac], XtNborderWidth, 0); ac++;
   XtSetValues (pane_widget, al, ac);
@@ -2167,7 +2195,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
   XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
   XtSetArg (al[ac], XtNemacsFrame, f); ac++;
   XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
-  XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
+  XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++;
   XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
   XtSetArg (al[ac], XtNborderWidth, 0); ac++;
   frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass, pane_widget,
@@ -2293,7 +2321,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
      be initialized to something relevant to the time we created the window.
      */
   XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget),
-                  FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols,
+                  FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
                   XA_ATOM, 32, PropModeAppend, NULL, 0);
 
   /* Make all the standard events reach the Emacs frame.  */
@@ -2453,8 +2481,8 @@ x_window (struct frame *f)
   /* Request "save yourself" and "delete window" commands from wm.  */
   {
     Atom protocols[2];
-    protocols[0] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window;
-    protocols[1] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself;
+    protocols[0] = FRAME_DISPLAY_INFO (f)->Xatom_wm_delete_window;
+    protocols[1] = FRAME_DISPLAY_INFO (f)->Xatom_wm_save_yourself;
     XSetWMProtocols (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), protocols, 2);
   }
 
@@ -2514,7 +2542,7 @@ x_icon (struct frame *f, Lisp_Object parms)
 {
   Lisp_Object icon_x, icon_y;
 #if 0
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
 #endif
 
   /* Set the position of the icon.  Note that twm groups all
@@ -2598,7 +2626,7 @@ x_make_gc (struct frame *f)
      this must be done on a per-frame basis.  */
   f->output_data.x->border_tile
     = (XCreatePixmapFromBitmapData
-       (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
+       (FRAME_X_DISPLAY (f), FRAME_DISPLAY_INFO (f)->root_window,
        gray_bits, gray_width, gray_height,
        FRAME_FOREGROUND_PIXEL (f),
        FRAME_BACKGROUND_PIXEL (f),
@@ -2664,7 +2692,7 @@ unwind_create_frame (Lisp_Object frame)
   if (NILP (Fmemq (frame, Vframe_list)))
     {
 #if defined GLYPH_DEBUG && defined ENABLE_CHECKING
-      struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+      struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
 #endif
 
       x_free_frame_resources (f);
@@ -2696,7 +2724,7 @@ unwind_create_frame_1 (Lisp_Object val)
 static void
 x_default_font_parameter (struct frame *f, Lisp_Object parms)
 {
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
                                       RES_TYPE_STRING);
   Lisp_Object font = Qnil;
@@ -2883,6 +2911,8 @@ This function is an internal primitive--use `make-frame' instead.  */)
   f->output_data.x->scroll_bar_top_shadow_pixel = -1;
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
 #endif /* USE_TOOLKIT_SCROLL_BARS */
+  f->output_data.x->white_relief.pixel = -1;
+  f->output_data.x->black_relief.pixel = -1;
 
   fset_icon_name (f,
                  x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
@@ -2890,9 +2920,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
   if (! STRINGP (f->icon_name))
     fset_icon_name (f, Qnil);
 
-  FRAME_X_DISPLAY_INFO (f) = dpyinfo;
+  FRAME_DISPLAY_INFO (f) = dpyinfo;
 
-  /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe.  */
+  /* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe.  */
   record_unwind_protect (do_unwind_create_frame, frame);
 
   /* These colors will be set anyway later, but it's important
@@ -2937,7 +2967,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
     }
   else
     {
-      f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
+      f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
       f->output_data.x->explicit_parent = 0;
     }
 
@@ -3003,6 +3033,10 @@ This function is an internal primitive--use `make-frame' instead.  */)
 #endif
                       "internalBorderWidth", "internalBorderWidth",
                       RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qright_divider_width, make_number (0),
+                      NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
+                      NULL, NULL, RES_TYPE_NUMBER);
   x_default_parameter (f, parms, Qvertical_scroll_bars,
 #if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
                       Qright,
@@ -3051,6 +3085,17 @@ This function is an internal primitive--use `make-frame' instead.  */)
      happen.  */
   init_frame_faces (f);
 
+  /* PXW: This is a duplicate from below.  We have to do it here since
+     otherwise x_set_tool_bar_lines will work with the character sizes
+     installed by init_frame_faces while the frame's pixel size is still
+     calculated from a character size of 1 and we subsequently hit the
+     eassert (height >= 0) assertion in window_box_height.  The
+     non-pixelwise code apparently worked around this because it had one
+     frame line vs one toolbar line which left us with a zero root
+     window height which was obviously wrong as well ...  */
+  change_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+                    FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1, 0, 0, 1);
+
   /* Set the menu-bar-lines and tool-bar-lines parameters.  We don't
      look up the X resources controlling the menu-bar and tool-bar
      here; they are processed specially at startup, and reflected in
@@ -3108,7 +3153,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   /* Now consider the frame official.  */
   f->terminal->reference_count++;
-  FRAME_X_DISPLAY_INFO (f)->reference_count++;
+  FRAME_DISPLAY_INFO (f)->reference_count++;
   Vframe_list = Fcons (frame, Vframe_list);
 
   /* We need to do this after creating the X window, so that the
@@ -3131,12 +3176,11 @@ This function is an internal primitive--use `make-frame' instead.  */)
   /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
      Change will not be effected unless different from the current
      FRAME_LINES (f).  */
-  width = FRAME_COLS (f);
-  height = FRAME_LINES (f);
-
-  SET_FRAME_COLS (f, 0);
-  FRAME_LINES (f) = 0;
-  change_frame_size (f, height, width, 1, 0, 0);
+  width = FRAME_TEXT_WIDTH (f);
+  height = FRAME_TEXT_HEIGHT (f);
+  FRAME_TEXT_HEIGHT (f) = 0;
+  SET_FRAME_WIDTH (f, 0);
+  change_frame_size (f, width, height, 1, 0, 0, 1);
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   /* Create the menu bar.  */
@@ -3233,7 +3277,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
 Lisp_Object
 x_get_focus_frame (struct frame *frame)
 {
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (frame);
+  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
   Lisp_Object xfocus;
   if (! dpyinfo->x_focus_frame)
     return Qnil;
@@ -3252,12 +3296,9 @@ x_get_focus_frame (struct frame *frame)
    policy.  But I think it's okay to use when it's clearly done
    following a user-command.  */
 
-DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
-       doc: /* Set the input focus to FRAME.
-FRAME nil means use the selected frame.  */)
-  (Lisp_Object frame)
+void
+x_focus_frame (struct frame *f)
 {
-  struct frame *f = decode_window_system_frame (frame);
   Display *dpy = FRAME_X_DISPLAY (f);
 
   block_input ();
@@ -3279,8 +3320,6 @@ FRAME nil means use the selected frame.  */)
 
   x_uncatch_errors ();
   unblock_input ();
-
-  return Qnil;
 }
 
 \f
@@ -3761,7 +3800,7 @@ x_make_monitor_attribute_list (struct MonitorInfo *monitors,
     {
       struct frame *f = XFRAME (frame);
 
-      if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo
+      if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo
          && !EQ (frame, tip_frame))
        {
          int i = x_get_monitor_for_frame (f, monitors, n_monitors);
@@ -3957,6 +3996,8 @@ x_get_monitor_attributes (struct x_display_info *dpyinfo)
   Lisp_Object attributes_list = Qnil;
   Display *dpy = dpyinfo->display;
 
+  (void) dpy; /* Suppress unused variable warning.  */
+
 #ifdef HAVE_XRANDR
   int xrr_event_base, xrr_error_base;
   bool xrr_ok = false;
@@ -4041,7 +4082,7 @@ Internal use only, use `display-monitor-attributes-list' instead.  */)
     {
       struct frame *f = XFRAME (frame);
 
-      if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo
+      if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo
          && !EQ (frame, tip_frame))
        {
          GdkWindow *gwin = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
@@ -4248,20 +4289,13 @@ select_visual (struct x_display_info *dpyinfo)
 static struct x_display_info *
 x_display_info_for_name (Lisp_Object name)
 {
-  Lisp_Object names;
   struct x_display_info *dpyinfo;
 
   CHECK_STRING (name);
 
-  for (dpyinfo = x_display_list, names = x_display_name_list;
-       dpyinfo;
-       dpyinfo = dpyinfo->next, names = XCDR (names))
-    {
-      Lisp_Object tem;
-      tem = Fstring_equal (XCAR (XCAR (names)), name);
-      if (!NILP (tem))
-       return dpyinfo;
-    }
+  for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
+    if (!NILP (Fstring_equal (XCAR (dpyinfo->name_list_element), name)))
+      return dpyinfo;
 
   /* Use this general default value to start with.  */
   Vx_resource_name = Vinvocation_name;
@@ -4344,11 +4378,11 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
        doc: /* Return the list of display names that Emacs has connections to.  */)
   (void)
 {
-  Lisp_Object tail, result;
+  Lisp_Object result = Qnil;
+  struct x_display_info *xdi;
 
-  result = Qnil;
-  for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
-    result = Fcons (XCAR (XCAR (tail)), result);
+  for (xdi = x_display_list; xdi; xdi = xdi->next)
+    result = Fcons (XCAR (xdi->name_list_element), result);
 
   return result;
 }
@@ -4542,7 +4576,7 @@ no value of TYPE (always string in the MS Windows case).  */)
     {
       CONS_TO_INTEGER (source, Window, target_window);
       if (! target_window)
-       target_window = FRAME_X_DISPLAY_INFO (f)->root_window;
+       target_window = FRAME_DISPLAY_INFO (f)->root_window;
     }
 
   block_input ();
@@ -4837,9 +4871,12 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   f->output_data.x->scroll_bar_top_shadow_pixel = -1;
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
 #endif /* USE_TOOLKIT_SCROLL_BARS */
+  f->output_data.x->white_relief.pixel = -1;
+  f->output_data.x->black_relief.pixel = -1;
+
   fset_icon_name (f, Qnil);
-  FRAME_X_DISPLAY_INFO (f) = dpyinfo;
-  f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
+  FRAME_DISPLAY_INFO (f) = dpyinfo;
+  f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
   f->output_data.x->explicit_parent = 0;
 
   /* These colors will be set anyway later, but it's important
@@ -4926,6 +4963,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
                       "internalBorderWidth", "internalBorderWidth",
                       RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qright_divider_width, make_number (0),
+                      NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qbottom_divider_width, make_number (0),
+                      NULL, NULL, RES_TYPE_NUMBER);
 
   /* Also do the stuff which must be set before the window exists.  */
   x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
@@ -4953,14 +4994,14 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
      happen.  */
   init_frame_faces (f);
 
-  f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
+  f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
 
   x_figure_window_size (f, parms, 0);
 
   {
     XSetWindowAttributes attrs;
     unsigned long mask;
-    Atom type = FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip;
+    Atom type = FRAME_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip;
 
     block_input ();
     mask = CWBackPixel | CWOverrideRedirect | CWEventMask;
@@ -4978,7 +5019,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
     tip_window
       = FRAME_X_WINDOW (f)
       = XCreateWindow (FRAME_X_DISPLAY (f),
-                      FRAME_X_DISPLAY_INFO (f)->root_window,
+                      FRAME_DISPLAY_INFO (f)->root_window,
                       /* x, y, width, height */
                       0, 0, 1, 1,
                       /* Border.  */
@@ -4986,7 +5027,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
                       CopyFromParent, InputOutput, CopyFromParent,
                       mask, &attrs);
     XChangeProperty (FRAME_X_DISPLAY (f), tip_window,
-                     FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type,
+                     FRAME_DISPLAY_INFO (f)->Xatom_net_window_type,
                      XA_ATOM, 32, PropModeReplace,
                      (unsigned char *)&type, 1);
     unblock_input ();
@@ -5008,7 +5049,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   height = FRAME_LINES (f);
   SET_FRAME_COLS (f, 0);
   FRAME_LINES (f) = 0;
-  change_frame_size (f, height, width, 1, 0, 0);
+  change_frame_size (f, width, height, 1, 0, 0, 0);
 
   /* Add `tooltip' frame parameter's default value. */
   if (NILP (Fframe_parameter (frame, Qtooltip)))
@@ -5021,10 +5062,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   {
     Lisp_Object disptype;
 
-    if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
+    if (FRAME_DISPLAY_INFO (f)->n_planes == 1)
       disptype = intern ("mono");
-    else if (FRAME_X_DISPLAY_INFO (f)->visual->class == GrayScale
-             || FRAME_X_DISPLAY_INFO (f)->visual->class == StaticGray)
+    else if (FRAME_DISPLAY_INFO (f)->visual->class == GrayScale
+             || FRAME_DISPLAY_INFO (f)->visual->class == StaticGray)
       disptype = intern ("grayscale");
     else
       disptype = intern ("color");
@@ -5058,7 +5099,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
 
   /* Now that the frame will be official, it counts as a reference to
      its display and terminal.  */
-  FRAME_X_DISPLAY_INFO (f)->reference_count++;
+  FRAME_DISPLAY_INFO (f)->reference_count++;
   f->terminal->reference_count++;
 
   /* It is now ok to make the frame official even if we get an error
@@ -5102,7 +5143,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object
   if (!INTEGERP (left) || !INTEGERP (top))
     {
       block_input ();
-      XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
+      XQueryPointer (FRAME_X_DISPLAY (f), FRAME_DISPLAY_INFO (f)->root_window,
                     &root, &child, root_x, root_y, &win_x, &win_y, &pmask);
       unblock_input ();
     }
@@ -5112,7 +5153,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object
   else if (*root_y + XINT (dy) <= 0)
     *root_y = 0; /* Can happen for negative dy */
   else if (*root_y + XINT (dy) + height
-          <= x_display_pixel_height (FRAME_X_DISPLAY_INFO (f)))
+          <= x_display_pixel_height (FRAME_DISPLAY_INFO (f)))
     /* It fits below the pointer */
     *root_y += XINT (dy);
   else if (height + XINT (dy) <= *root_y)
@@ -5127,7 +5168,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object
   else if (*root_x + XINT (dx) <= 0)
     *root_x = 0; /* Can happen for negative dx */
   else if (*root_x + XINT (dx) + width
-          <= x_display_pixel_width (FRAME_X_DISPLAY_INFO (f)))
+          <= x_display_pixel_width (FRAME_DISPLAY_INFO (f)))
     /* It fits to the right of the pointer.  */
     *root_x += XINT (dx);
   else if (width + XINT (dx) <= *root_x)
@@ -5268,6 +5309,10 @@ Text larger than the specified size is clipped.  */)
     parms = Fcons (Fcons (Qinternal_border_width, make_number (3)), parms);
   if (NILP (Fassq (Qborder_width, parms)))
     parms = Fcons (Fcons (Qborder_width, make_number (1)), parms);
+  if (NILP (Fassq (Qbottom_divider_width, parms)))
+    parms = Fcons (Fcons (Qbottom_divider_width, make_number (0)), parms);
+  if (NILP (Fassq (Qright_divider_width, parms)))
+    parms = Fcons (Fcons (Qright_divider_width, make_number (0)), parms);
   if (NILP (Fassq (Qborder_color, parms)))
     parms = Fcons (Fcons (Qborder_color, build_string ("lightyellow")), parms);
   if (NILP (Fassq (Qbackground_color, parms)))
@@ -5276,13 +5321,15 @@ Text larger than the specified size is clipped.  */)
 
   /* Create a frame for the tooltip, and record it in the global
      variable tip_frame.  */
-  frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string);
+  frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms, string);
   f = XFRAME (frame);
 
   /* Set up the frame's root window.  */
   w = XWINDOW (FRAME_ROOT_WINDOW (f));
   w->left_col = 0;
   w->top_line = 0;
+  w->pixel_left = 0;
+  w->pixel_top = 0;
 
   if (CONSP (Vx_max_tooltip_size)
       && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX)
@@ -5297,6 +5344,9 @@ Text larger than the specified size is clipped.  */)
       w->total_lines = 40;
     }
 
+  w->pixel_width = w->total_cols * FRAME_COLUMN_WIDTH (f);
+  w->pixel_height = w->total_lines * FRAME_LINE_HEIGHT (f);
+
   FRAME_TOTAL_COLS (f) = w->total_cols;
   adjust_frame_glyphs (f);
   w->pseudo_window_p = 1;
@@ -5363,9 +5413,11 @@ Text larger than the specified size is clipped.  */)
     {
       /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
         not in pixels.  */
+      w->pixel_width = width;
       width /= WINDOW_FRAME_COLUMN_WIDTH (w);
       w->total_cols = width;
       FRAME_TOTAL_COLS (f) = width;
+      SET_FRAME_WIDTH (f, width);
       adjust_frame_glyphs (f);
       clear_glyph_matrix (w->desired_matrix);
       clear_glyph_matrix (w->current_matrix);
@@ -5476,7 +5528,7 @@ Value is t if tooltip was open, nil otherwise.  */)
        struct frame *f = SELECTED_FRAME ();
        w = f->output_data.x->menubar_widget;
 
-       if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen)
+       if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen)
            && w != NULL)
          {
            block_input ();
@@ -5966,6 +6018,8 @@ frame_parm_handler x_frame_parm_handlers[] =
   x_set_icon_name,
   x_set_icon_type,
   x_set_internal_border_width,
+  x_set_right_divider_width,
+  x_set_bottom_divider_width,
   x_set_menu_bar_lines,
   x_set_mouse_color,
   x_explicitly_set_name,
@@ -6049,6 +6103,13 @@ This variable takes effect when you create a new frame
 or when you set the mouse color.  */);
   Vx_window_horizontal_drag_shape = Qnil;
 
+  DEFVAR_LISP ("x-window-vertical-drag-cursor",
+             Vx_window_vertical_drag_shape,
+  doc: /* Pointer shape to use for indicating a window can be dragged vertically.
+This variable takes effect when you create a new frame
+or when you set the mouse color.  */);
+  Vx_window_vertical_drag_shape = Qnil;
+
   DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel,
     doc: /* A string indicating the foreground color of the cursor box.  */);
   Vx_cursor_fore_pixel = Qnil;
@@ -6170,7 +6231,6 @@ When using Gtk+ tooltips, the tooltip face is not used.  */);
   defsubr (&Sx_close_connection);
   defsubr (&Sx_display_list);
   defsubr (&Sx_synchronize);
-  defsubr (&Sx_focus_frame);
   defsubr (&Sx_backspace_delete_keys_p);
 
   defsubr (&Sx_show_tip);
@@ -6192,5 +6252,3 @@ When using Gtk+ tooltips, the tooltip face is not used.  */);
   defsubr (&Sx_select_font);
 #endif
 }
-
-#endif /* HAVE_X_WINDOWS */