aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-06-01 08:07:38 +0000
committerRichard M. Stallman1993-06-01 08:07:38 +0000
commit714fd2eafb73275fea0ed71f3f6c763975dd9aa0 (patch)
treeefcc383f4013248d515f390464bb6bcde880a74b
parent88f3b4fc653b9a1e02f22d69da7beb9be702d70a (diff)
downloademacs-714fd2eafb73275fea0ed71f3f6c763975dd9aa0.tar.gz
emacs-714fd2eafb73275fea0ed71f3f6c763975dd9aa0.zip
(x_set_menu_bar_lines): Use FRAME_NEW_HEIGHT and ..._WIDTH.
(x_window): In XSetClassHint, use a shortened version of the frame name.
-rw-r--r--src/xfns.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 8e2884f83b8..65fada912d1 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -946,8 +946,16 @@ x_set_menu_bar_lines (f, value, oldval)
946 946
947 FRAME_MENU_BAR_LINES (f) = nlines; 947 FRAME_MENU_BAR_LINES (f) = nlines;
948 x_set_menu_bar_lines_1 (f->root_window, nlines - olines); 948 x_set_menu_bar_lines_1 (f->root_window, nlines - olines);
949 x_set_window_size (f, FRAME_WIDTH (f), 949 /* Use FRAME_NEW_WIDTH, HEIGHT so as not to override a size change
950 FRAME_HEIGHT (f) + nlines - olines); 950 made by the user but not fully reflected in the Emacs frame object. */
951 x_set_window_size (f,
952 (FRAME_NEW_WIDTH (f)
953 ? FRAME_NEW_WIDTH (f)
954 : FRAME_WIDTH (f)),
955 ((FRAME_NEW_HEIGHT (f)
956 ? FRAME_NEW_HEIGHT (f)
957 : FRAME_HEIGHT (f))
958 + nlines - olines));
951} 959}
952 960
953/* Change the name of frame F to ARG. If ARG is nil, set F's name to 961/* Change the name of frame F to ARG. If ARG is nil, set F's name to
@@ -1476,6 +1484,8 @@ x_window (f)
1476 XSetWindowAttributes attributes; 1484 XSetWindowAttributes attributes;
1477 unsigned long attribute_mask; 1485 unsigned long attribute_mask;
1478 XClassHint class_hints; 1486 XClassHint class_hints;
1487 char *shortname;
1488 char *p;
1479 1489
1480 attributes.background_pixel = f->display.x->background_pixel; 1490 attributes.background_pixel = f->display.x->background_pixel;
1481 attributes.border_pixel = f->display.x->border_pixel; 1491 attributes.border_pixel = f->display.x->border_pixel;
@@ -1501,7 +1511,15 @@ x_window (f)
1501 screen_visual, /* set in Fx_open_connection */ 1511 screen_visual, /* set in Fx_open_connection */
1502 attribute_mask, &attributes); 1512 attribute_mask, &attributes);
1503 1513
1504 class_hints.res_name = (char *) XSTRING (f->name)->data; 1514 /* X resource names should not have periods in them.
1515 So copy the frame name, discarding from the first period onward. */
1516 shortname = (char *) alloca (XSTRING (f->name)->size + 1);
1517 bcopy (XSTRING (f->name)->data, shortname, XSTRING (f->name)->size + 1);
1518 for (p = shortname; *p; p++)
1519 if (*p == '.')
1520 *p = 0;
1521
1522 class_hints.res_name = shortname;
1505 class_hints.res_class = EMACS_CLASS; 1523 class_hints.res_class = EMACS_CLASS;
1506 XSetClassHint (x_current_display, FRAME_X_WINDOW (f), &class_hints); 1524 XSetClassHint (x_current_display, FRAME_X_WINDOW (f), &class_hints);
1507 1525