changeset 3391:025f68746fc3

(x_set_menu_bar_lines): Use FRAME_NEW_HEIGHT and ..._WIDTH. (x_window): In XSetClassHint, use a shortened version of the frame name.
author Richard M. Stallman <rms@gnu.org>
date Tue, 01 Jun 1993 08:07:38 +0000
parents ce971b0a5918
children 0cab056764c8
files src/xfns.c
diffstat 1 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Tue Jun 01 07:32:23 1993 +0000
+++ b/src/xfns.c	Tue Jun 01 08:07:38 1993 +0000
@@ -946,8 +946,16 @@
 
   FRAME_MENU_BAR_LINES (f) = nlines;
   x_set_menu_bar_lines_1 (f->root_window, nlines - olines);
-  x_set_window_size (f, FRAME_WIDTH (f),
-		     FRAME_HEIGHT (f) + nlines - olines);
+  /* Use FRAME_NEW_WIDTH, HEIGHT so as not to override a size change
+     made by the user but not fully reflected in the Emacs frame object.  */
+  x_set_window_size (f,
+		     (FRAME_NEW_WIDTH (f)
+		      ? FRAME_NEW_WIDTH (f)
+		      : FRAME_WIDTH (f)),
+		     ((FRAME_NEW_HEIGHT (f)
+		       ? FRAME_NEW_HEIGHT (f)
+		       : FRAME_HEIGHT (f))
+		      + nlines - olines));
 }
 
 /* Change the name of frame F to ARG.  If ARG is nil, set F's name to
@@ -1476,6 +1484,8 @@
   XSetWindowAttributes attributes;
   unsigned long attribute_mask;
   XClassHint class_hints;
+  char *shortname;
+  char *p;
 
   attributes.background_pixel = f->display.x->background_pixel;
   attributes.border_pixel = f->display.x->border_pixel;
@@ -1501,7 +1511,15 @@
 		     screen_visual, /* set in Fx_open_connection */
 		     attribute_mask, &attributes);
 
-  class_hints.res_name = (char *) XSTRING (f->name)->data;
+  /* X resource names should not have periods in them.
+     So copy the frame name, discarding from the first period onward.  */
+  shortname = (char *) alloca (XSTRING (f->name)->size + 1);
+  bcopy (XSTRING (f->name)->data, shortname, XSTRING (f->name)->size + 1);
+  for (p = shortname; *p; p++)
+    if (*p == '.')
+      *p = 0;
+
+  class_hints.res_name = shortname;
   class_hints.res_class = EMACS_CLASS;
   XSetClassHint (x_current_display, FRAME_X_WINDOW (f), &class_hints);