aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Miller2021-01-26 10:36:52 +0100
committerMartin Rudalics2021-01-26 10:36:52 +0100
commitff7b1a133bfa7f2614650f8551824ffaef13fadc (patch)
tree0314a68f16b478f5537a28395c55e15f82b01876 /src
parentb4b6a2684062d4470143b6ea460b5e82012554a1 (diff)
downloademacs-ff7b1a133bfa7f2614650f8551824ffaef13fadc.tar.gz
emacs-ff7b1a133bfa7f2614650f8551824ffaef13fadc.zip
Add distinct controls for child frames' borders (Bug#45620)
The background of the 'child-frame-border' face instead of the 'internal-border' face now controls the color of child frames' borders. The 'child-frame-border-width' frame parameter is now used for the width of child frames' borders instead of internal-border-width', though we still fall back on using the latter if the former is not set. * doc/lispref/frames.texi (Frame Layout): Mention 'child-frame-border' and 'child-frame-border-width'. (Layout Parameters): Mention 'child-frame-border-width'. * etc/NEWS: Mention new face 'child-frame-border' and frame parameter 'child-frame-border-width'. * lisp/faces.el (child-frame-border): New face. * src/dispextern.h (enum face_id): Add CHILD_FRAME_BORDER_FACE_ID. * src/frame.c (Fframe_child_frame_border_width): New function. (gui_report_frame_params): Add entry for Qchild_frame_border_width. * src/frame.h (struct frame): New slot child_frame_border_width. (FRAME_CHILD_FRAME_BORDER_WIDTH): New inlined function. * src/nsfns.m (ns_set_child_frame_border_width): New function. (Fx_create_frame): Handle Qchild_frame_border_width parameter. (ns_frame_parm_handlers): Add ns_set_child_frame_border_width. * src/nsterm.m (ns_clear_under_internal_border): Handle CHILD_FRAME_BORDER_FACE_ID. * src/w32fns.c (w32_clear_under_internal_border): Handle CHILD_FRAME_BORDER_FACE_ID. (w32_set_internal_border_width): New function. (Fx_create_frame): Handle Qchild_frame_border_width parameter. (w32_frame_parm_handlers): Add w32_set_child_frame_border_width. * src/xfaces.c (lookup_basic_face, realize_basic_faces): Handle CHILD_FRAME_BORDER_FACE_ID. * src/xfns.c (x_set_child_frame_border_width): New function. (Fx_create_frame): Handle Qchild_frame_border_width parameter. (x_frame_parm_handlers): Add x_set_child_frame_border_width. * src/xterm.c (x_clear_under_internal_border) (x_after_update_window_line): Handle CHILD_FRAME_BORDER_FACE_ID.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h1
-rw-r--r--src/frame.c12
-rw-r--r--src/frame.h24
-rw-r--r--src/nsfns.m19
-rw-r--r--src/nsterm.m10
-rw-r--r--src/w32fns.c59
-rw-r--r--src/xfaces.c3
-rw-r--r--src/xfns.c46
-rw-r--r--src/xterm.c20
9 files changed, 180 insertions, 14 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 3ad98b8344e..f4e872644db 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1826,6 +1826,7 @@ enum face_id
1826 WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID, 1826 WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID,
1827 WINDOW_DIVIDER_LAST_PIXEL_FACE_ID, 1827 WINDOW_DIVIDER_LAST_PIXEL_FACE_ID,
1828 INTERNAL_BORDER_FACE_ID, 1828 INTERNAL_BORDER_FACE_ID,
1829 CHILD_FRAME_BORDER_FACE_ID,
1829 TAB_BAR_FACE_ID, 1830 TAB_BAR_FACE_ID,
1830 TAB_LINE_FACE_ID, 1831 TAB_LINE_FACE_ID,
1831 BASIC_FACE_ID_SENTINEL 1832 BASIC_FACE_ID_SENTINEL
diff --git a/src/frame.c b/src/frame.c
index 599c4075f88..a2167ce1e49 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3543,6 +3543,13 @@ DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0,
3543 return make_fixnum (FRAME_TOTAL_FRINGE_WIDTH (decode_any_frame (frame))); 3543 return make_fixnum (FRAME_TOTAL_FRINGE_WIDTH (decode_any_frame (frame)));
3544} 3544}
3545 3545
3546DEFUN ("frame-child-frame-border-width", Fframe_child_frame_border_width, Sframe_child_frame_border_width, 0, 1, 0,
3547 doc: /* Return width of FRAME's child-frame border in pixels. */)
3548 (Lisp_Object frame)
3549{
3550 return make_fixnum (FRAME_CHILD_FRAME_BORDER_WIDTH (decode_any_frame (frame)));
3551}
3552
3546DEFUN ("frame-internal-border-width", Fframe_internal_border_width, Sframe_internal_border_width, 0, 1, 0, 3553DEFUN ("frame-internal-border-width", Fframe_internal_border_width, Sframe_internal_border_width, 0, 1, 0,
3547 doc: /* Return width of FRAME's internal border in pixels. */) 3554 doc: /* Return width of FRAME's internal border in pixels. */)
3548 (Lisp_Object frame) 3555 (Lisp_Object frame)
@@ -3759,6 +3766,7 @@ static const struct frame_parm_table frame_parms[] =
3759 {"foreground-color", -1}, 3766 {"foreground-color", -1},
3760 {"icon-name", SYMBOL_INDEX (Qicon_name)}, 3767 {"icon-name", SYMBOL_INDEX (Qicon_name)},
3761 {"icon-type", SYMBOL_INDEX (Qicon_type)}, 3768 {"icon-type", SYMBOL_INDEX (Qicon_type)},
3769 {"child-frame-border-width", SYMBOL_INDEX (Qchild_frame_border_width)},
3762 {"internal-border-width", SYMBOL_INDEX (Qinternal_border_width)}, 3770 {"internal-border-width", SYMBOL_INDEX (Qinternal_border_width)},
3763 {"right-divider-width", SYMBOL_INDEX (Qright_divider_width)}, 3771 {"right-divider-width", SYMBOL_INDEX (Qright_divider_width)},
3764 {"bottom-divider-width", SYMBOL_INDEX (Qbottom_divider_width)}, 3772 {"bottom-divider-width", SYMBOL_INDEX (Qbottom_divider_width)},
@@ -4302,6 +4310,8 @@ gui_report_frame_params (struct frame *f, Lisp_Object *alistptr)
4302 4310
4303 store_in_alist (alistptr, Qborder_width, 4311 store_in_alist (alistptr, Qborder_width,
4304 make_fixnum (f->border_width)); 4312 make_fixnum (f->border_width));
4313 store_in_alist (alistptr, Qchild_frame_border_width,
4314 make_fixnum (FRAME_CHILD_FRAME_BORDER_WIDTH (f)));
4305 store_in_alist (alistptr, Qinternal_border_width, 4315 store_in_alist (alistptr, Qinternal_border_width,
4306 make_fixnum (FRAME_INTERNAL_BORDER_WIDTH (f))); 4316 make_fixnum (FRAME_INTERNAL_BORDER_WIDTH (f)));
4307 store_in_alist (alistptr, Qright_divider_width, 4317 store_in_alist (alistptr, Qright_divider_width,
@@ -5999,6 +6009,7 @@ syms_of_frame (void)
5999 DEFSYM (Qhorizontal_scroll_bars, "horizontal-scroll-bars"); 6009 DEFSYM (Qhorizontal_scroll_bars, "horizontal-scroll-bars");
6000 DEFSYM (Qicon_name, "icon-name"); 6010 DEFSYM (Qicon_name, "icon-name");
6001 DEFSYM (Qicon_type, "icon-type"); 6011 DEFSYM (Qicon_type, "icon-type");
6012 DEFSYM (Qchild_frame_border_width, "child-frame-border-width");
6002 DEFSYM (Qinternal_border_width, "internal-border-width"); 6013 DEFSYM (Qinternal_border_width, "internal-border-width");
6003 DEFSYM (Qleft_fringe, "left-fringe"); 6014 DEFSYM (Qleft_fringe, "left-fringe");
6004 DEFSYM (Qline_spacing, "line-spacing"); 6015 DEFSYM (Qline_spacing, "line-spacing");
@@ -6423,6 +6434,7 @@ iconify the top level frame instead. */);
6423 defsubr (&Sscroll_bar_width); 6434 defsubr (&Sscroll_bar_width);
6424 defsubr (&Sscroll_bar_height); 6435 defsubr (&Sscroll_bar_height);
6425 defsubr (&Sfringe_width); 6436 defsubr (&Sfringe_width);
6437 defsubr (&Sframe_child_frame_border_width);
6426 defsubr (&Sframe_internal_border_width); 6438 defsubr (&Sframe_internal_border_width);
6427 defsubr (&Sright_divider_width); 6439 defsubr (&Sright_divider_width);
6428 defsubr (&Sbottom_divider_width); 6440 defsubr (&Sbottom_divider_width);
diff --git a/src/frame.h b/src/frame.h
index 8cf41dc0046..7b3bf20a241 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -534,6 +534,10 @@ struct frame
534 /* Border width of the frame window as known by the (X) window system. */ 534 /* Border width of the frame window as known by the (X) window system. */
535 int border_width; 535 int border_width;
536 536
537 /* Width of child frames' internal border. Acts as
538 internal_border_width for child frames. */
539 int child_frame_border_width;
540
537 /* Width of the internal border. This is a line of background color 541 /* Width of the internal border. This is a line of background color
538 just inside the window's border. When the frame is selected, 542 just inside the window's border. When the frame is selected,
539 a highlighting is displayed inside the internal border. */ 543 a highlighting is displayed inside the internal border. */
@@ -1432,11 +1436,27 @@ FRAME_TOTAL_FRINGE_WIDTH (struct frame *f)
1432 return FRAME_LEFT_FRINGE_WIDTH (f) + FRAME_RIGHT_FRINGE_WIDTH (f); 1436 return FRAME_LEFT_FRINGE_WIDTH (f) + FRAME_RIGHT_FRINGE_WIDTH (f);
1433} 1437}
1434 1438
1435/* Pixel-width of internal border lines. */ 1439INLINE int
1440FRAME_CHILD_FRAME_BORDER_WIDTH (struct frame *f)
1441{
1442 return frame_dimension (f->child_frame_border_width);
1443}
1444
1445/* Pixel-width of internal border. Uses child_frame_border_width for
1446 child frames if possible and falls back on internal_border_width
1447 otherwise. */
1436INLINE int 1448INLINE int
1437FRAME_INTERNAL_BORDER_WIDTH (struct frame *f) 1449FRAME_INTERNAL_BORDER_WIDTH (struct frame *f)
1438{ 1450{
1439 return frame_dimension (f->internal_border_width); 1451#ifdef HAVE_WINDOW_SYSTEM
1452 return FRAME_PARENT_FRAME(f)
1453 ? (f->child_frame_border_width
1454 ? FRAME_CHILD_FRAME_BORDER_WIDTH(f)
1455 : frame_dimension (f->internal_border_width))
1456 : frame_dimension (f->internal_border_width);
1457#else
1458 return frame_dimension (f->internal_border_width)
1459#endif
1440} 1460}
1441 1461
1442/* Pixel-size of window divider lines. */ 1462/* Pixel-size of window divider lines. */
diff --git a/src/nsfns.m b/src/nsfns.m
index 24ea7d7f63b..c383e2f7ecf 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -687,6 +687,21 @@ ns_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
687 } 687 }
688} 688}
689 689
690static void
691ns_set_child_frame_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
692{
693 int old_width = FRAME_CHILD_FRAME_BORDER_WIDTH (f);
694 int new_width = check_int_nonnegative (arg);
695
696 if (new_width == old_width)
697 return;
698 f->child_frame_border_width = new_width;
699
700 if (FRAME_NATIVE_WINDOW (f) != 0)
701 adjust_frame_size (f, -1, -1, 3, 0, Qchild_frame_border_width);
702
703 SET_FRAME_GARBAGED (f);
704}
690 705
691static void 706static void
692ns_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 707ns_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
@@ -912,6 +927,7 @@ frame_parm_handler ns_frame_parm_handlers[] =
912 ns_set_foreground_color, 927 ns_set_foreground_color,
913 ns_set_icon_name, 928 ns_set_icon_name,
914 ns_set_icon_type, 929 ns_set_icon_type,
930 ns_set_child_frame_border_width,
915 ns_set_internal_border_width, 931 ns_set_internal_border_width,
916 gui_set_right_divider_width, /* generic OK */ 932 gui_set_right_divider_width, /* generic OK */
917 gui_set_bottom_divider_width, /* generic OK */ 933 gui_set_bottom_divider_width, /* generic OK */
@@ -1197,6 +1213,9 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1197 gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2), 1213 gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
1198 "internalBorderWidth", "InternalBorderWidth", 1214 "internalBorderWidth", "InternalBorderWidth",
1199 RES_TYPE_NUMBER); 1215 RES_TYPE_NUMBER);
1216 gui_default_parameter (f, parms, Qchild_frame_border_width, make_fixnum (2),
1217 "childFrameBorderWidth", "childFrameBorderWidth",
1218 RES_TYPE_NUMBER);
1200 gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0), 1219 gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
1201 NULL, NULL, RES_TYPE_NUMBER); 1220 NULL, NULL, RES_TYPE_NUMBER);
1202 gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0), 1221 gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
diff --git a/src/nsterm.m b/src/nsterm.m
index df3934c5c34..1b2328628ee 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3037,9 +3037,13 @@ ns_clear_under_internal_border (struct frame *f)
3037 NSRectEdge edge[] = {NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; 3037 NSRectEdge edge[] = {NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge};
3038 3038
3039 int face_id = 3039 int face_id =
3040 !NILP (Vface_remapping_alist) 3040 (FRAME_PARENT_FRAME (f)
3041 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) 3041 ? (!NILP (Vface_remapping_alist)
3042 : INTERNAL_BORDER_FACE_ID; 3042 ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID)
3043 : CHILD_FRAME_BORDER_FACE_ID)
3044 : (!NILP (Vface_remapping_alist)
3045 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID)
3046 : INTERNAL_BORDER_FACE_ID));
3043 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); 3047 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
3044 3048
3045 if (!face) 3049 if (!face)
diff --git a/src/w32fns.c b/src/w32fns.c
index c1e18ff7fad..29d2e3d75f9 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1519,9 +1519,13 @@ w32_clear_under_internal_border (struct frame *f)
1519 int width = FRAME_PIXEL_WIDTH (f); 1519 int width = FRAME_PIXEL_WIDTH (f);
1520 int height = FRAME_PIXEL_HEIGHT (f); 1520 int height = FRAME_PIXEL_HEIGHT (f);
1521 int face_id = 1521 int face_id =
1522 !NILP (Vface_remapping_alist) 1522 (FRAME_PARENT_FRAME (f)
1523 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) 1523 ? (!NILP (Vface_remapping_alist)
1524 : INTERNAL_BORDER_FACE_ID; 1524 ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID)
1525 : CHILD_FRAME_BORDER_FACE_ID)
1526 : (!NILP (Vface_remapping_alist)
1527 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID)
1528 : INTERNAL_BORDER_FACE_ID));
1525 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); 1529 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
1526 1530
1527 block_input (); 1531 block_input ();
@@ -1548,6 +1552,32 @@ w32_clear_under_internal_border (struct frame *f)
1548 } 1552 }
1549} 1553}
1550 1554
1555/**
1556 * w32_set_child_frame_border_width:
1557 *
1558 * Set width of child frame F's internal border to ARG pixels.
1559 * ARG < 0 is * treated like ARG = 0.
1560 */
1561static void
1562w32_set_child_frame_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1563{
1564 int argval = check_integer_range (arg, INT_MIN, INT_MAX);
1565 int border = max (argval, 0);
1566
1567 if (border != FRAME_CHILD_FRAME_BORDER_WIDTH (f))
1568 {
1569 f->child_frame_border_width = border;
1570
1571 if (FRAME_NATIVE_WINDOW (f) != 0)
1572 {
1573 adjust_frame_size (f, -1, -1, 3, false, Qchild_frame_border_width);
1574
1575 if (FRAME_VISIBLE_P (f))
1576 w32_clear_under_internal_border (f);
1577 }
1578 }
1579}
1580
1551 1581
1552/** 1582/**
1553 * w32_set_internal_border_width: 1583 * w32_set_internal_border_width:
@@ -5873,6 +5903,28 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
5873 parameters); 5903 parameters);
5874 } 5904 }
5875 5905
5906 /* Same for child frames. */
5907 if (NILP (Fassq (Qchild_frame_border_width, parameters)))
5908 {
5909 Lisp_Object value;
5910
5911 value = gui_display_get_arg (dpyinfo, parameters, Qchild_frame_border_width,
5912 "childFrameBorderWidth", "childFrameBorderWidth",
5913 RES_TYPE_NUMBER);
5914 if (! EQ (value, Qunbound))
5915 parameters = Fcons (Fcons (Qchild_frame_border_width, value),
5916 parameters);
5917
5918 }
5919
5920 gui_default_parameter (f, parameters, Qchild_frame_border_width,
5921#ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */
5922 make_fixnum (0),
5923#else
5924 make_fixnum (1),
5925#endif
5926 "childFrameBorderWidth", "childFrameBorderWidth",
5927 RES_TYPE_NUMBER);
5876 gui_default_parameter (f, parameters, Qinternal_border_width, make_fixnum (0), 5928 gui_default_parameter (f, parameters, Qinternal_border_width, make_fixnum (0),
5877 "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER); 5929 "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
5878 gui_default_parameter (f, parameters, Qright_divider_width, make_fixnum (0), 5930 gui_default_parameter (f, parameters, Qright_divider_width, make_fixnum (0),
@@ -10232,6 +10284,7 @@ frame_parm_handler w32_frame_parm_handlers[] =
10232 w32_set_foreground_color, 10284 w32_set_foreground_color,
10233 w32_set_icon_name, 10285 w32_set_icon_name,
10234 w32_set_icon_type, 10286 w32_set_icon_type,
10287 w32_set_child_frame_border_width,
10235 w32_set_internal_border_width, 10288 w32_set_internal_border_width,
10236 gui_set_right_divider_width, 10289 gui_set_right_divider_width,
10237 gui_set_bottom_divider_width, 10290 gui_set_bottom_divider_width,
diff --git a/src/xfaces.c b/src/xfaces.c
index 258b365eda3..12087138e51 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4914,6 +4914,7 @@ lookup_basic_face (struct window *w, struct frame *f, int face_id)
4914 case WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID: name = Qwindow_divider_first_pixel; break; 4914 case WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID: name = Qwindow_divider_first_pixel; break;
4915 case WINDOW_DIVIDER_LAST_PIXEL_FACE_ID: name = Qwindow_divider_last_pixel; break; 4915 case WINDOW_DIVIDER_LAST_PIXEL_FACE_ID: name = Qwindow_divider_last_pixel; break;
4916 case INTERNAL_BORDER_FACE_ID: name = Qinternal_border; break; 4916 case INTERNAL_BORDER_FACE_ID: name = Qinternal_border; break;
4917 case CHILD_FRAME_BORDER_FACE_ID: name = Qchild_frame_border; break;
4917 4918
4918 default: 4919 default:
4919 emacs_abort (); /* the caller is supposed to pass us a basic face id */ 4920 emacs_abort (); /* the caller is supposed to pass us a basic face id */
@@ -5620,6 +5621,7 @@ realize_basic_faces (struct frame *f)
5620 realize_named_face (f, Qwindow_divider_last_pixel, 5621 realize_named_face (f, Qwindow_divider_last_pixel,
5621 WINDOW_DIVIDER_LAST_PIXEL_FACE_ID); 5622 WINDOW_DIVIDER_LAST_PIXEL_FACE_ID);
5622 realize_named_face (f, Qinternal_border, INTERNAL_BORDER_FACE_ID); 5623 realize_named_face (f, Qinternal_border, INTERNAL_BORDER_FACE_ID);
5624 realize_named_face (f, Qchild_frame_border, CHILD_FRAME_BORDER_FACE_ID);
5623 realize_named_face (f, Qtab_bar, TAB_BAR_FACE_ID); 5625 realize_named_face (f, Qtab_bar, TAB_BAR_FACE_ID);
5624 realize_named_face (f, Qtab_line, TAB_LINE_FACE_ID); 5626 realize_named_face (f, Qtab_line, TAB_LINE_FACE_ID);
5625 5627
@@ -6973,6 +6975,7 @@ syms_of_xfaces (void)
6973 DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel"); 6975 DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel");
6974 DEFSYM (Qwindow_divider_last_pixel, "window-divider-last-pixel"); 6976 DEFSYM (Qwindow_divider_last_pixel, "window-divider-last-pixel");
6975 DEFSYM (Qinternal_border, "internal-border"); 6977 DEFSYM (Qinternal_border, "internal-border");
6978 DEFSYM (Qchild_frame_border, "child-frame-border");
6976 6979
6977 /* TTY color-related functions (defined in tty-colors.el). */ 6980 /* TTY color-related functions (defined in tty-colors.el). */
6978 DEFSYM (Qtty_color_desc, "tty-color-desc"); 6981 DEFSYM (Qtty_color_desc, "tty-color-desc");
diff --git a/src/xfns.c b/src/xfns.c
index 9ab537ca8d9..cac41ee4856 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1800,6 +1800,28 @@ x_change_tool_bar_height (struct frame *f, int height)
1800#endif /* USE_GTK */ 1800#endif /* USE_GTK */
1801} 1801}
1802 1802
1803static void
1804x_set_child_frame_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1805{
1806 int border = check_int_nonnegative (arg);
1807
1808 if (border != FRAME_CHILD_FRAME_BORDER_WIDTH (f))
1809 {
1810 f->child_frame_border_width = border;
1811
1812#ifdef USE_X_TOOLKIT
1813 if (FRAME_X_OUTPUT (f)->edit_widget)
1814 widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget);
1815#endif
1816
1817 if (FRAME_X_WINDOW (f))
1818 {
1819 adjust_frame_size (f, -1, -1, 3, false, Qchild_frame_border_width);
1820 x_clear_under_internal_border (f);
1821 }
1822 }
1823
1824}
1803 1825
1804static void 1826static void
1805x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 1827x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
@@ -3897,6 +3919,29 @@ This function is an internal primitive--use `make-frame' instead. */)
3897 parms = Fcons (Fcons (Qinternal_border_width, value), 3919 parms = Fcons (Fcons (Qinternal_border_width, value),
3898 parms); 3920 parms);
3899 } 3921 }
3922
3923 /* Same for child frames. */
3924 if (NILP (Fassq (Qchild_frame_border_width, parms)))
3925 {
3926 Lisp_Object value;
3927
3928 value = gui_display_get_arg (dpyinfo, parms, Qchild_frame_border_width,
3929 "childFrameBorderWidth", "childFrameBorderWidth",
3930 RES_TYPE_NUMBER);
3931 if (! EQ (value, Qunbound))
3932 parms = Fcons (Fcons (Qchild_frame_border_width, value),
3933 parms);
3934
3935 }
3936
3937 gui_default_parameter (f, parms, Qchild_frame_border_width,
3938#ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */
3939 make_fixnum (0),
3940#else
3941 make_fixnum (1),
3942#endif
3943 "childFrameBorderWidth", "childFrameBorderWidth",
3944 RES_TYPE_NUMBER);
3900 gui_default_parameter (f, parms, Qinternal_border_width, 3945 gui_default_parameter (f, parms, Qinternal_border_width,
3901#ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */ 3946#ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */
3902 make_fixnum (0), 3947 make_fixnum (0),
@@ -7762,6 +7807,7 @@ frame_parm_handler x_frame_parm_handlers[] =
7762 x_set_foreground_color, 7807 x_set_foreground_color,
7763 x_set_icon_name, 7808 x_set_icon_name,
7764 x_set_icon_type, 7809 x_set_icon_type,
7810 x_set_child_frame_border_width,
7765 x_set_internal_border_width, 7811 x_set_internal_border_width,
7766 gui_set_right_divider_width, 7812 gui_set_right_divider_width,
7767 gui_set_bottom_divider_width, 7813 gui_set_bottom_divider_width,
diff --git a/src/xterm.c b/src/xterm.c
index b8374fed8b1..a855d2d67aa 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1293,9 +1293,13 @@ x_clear_under_internal_border (struct frame *f)
1293 int height = FRAME_PIXEL_HEIGHT (f); 1293 int height = FRAME_PIXEL_HEIGHT (f);
1294 int margin = FRAME_TOP_MARGIN_HEIGHT (f); 1294 int margin = FRAME_TOP_MARGIN_HEIGHT (f);
1295 int face_id = 1295 int face_id =
1296 !NILP (Vface_remapping_alist) 1296 (FRAME_PARENT_FRAME (f)
1297 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) 1297 ? (!NILP (Vface_remapping_alist)
1298 : INTERNAL_BORDER_FACE_ID; 1298 ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID)
1299 : CHILD_FRAME_BORDER_FACE_ID)
1300 : (!NILP (Vface_remapping_alist)
1301 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID)
1302 : INTERNAL_BORDER_FACE_ID));
1299 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); 1303 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
1300 1304
1301 block_input (); 1305 block_input ();
@@ -1360,9 +1364,13 @@ x_after_update_window_line (struct window *w, struct glyph_row *desired_row)
1360 { 1364 {
1361 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); 1365 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
1362 int face_id = 1366 int face_id =
1363 !NILP (Vface_remapping_alist) 1367 (FRAME_PARENT_FRAME (f)
1364 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) 1368 ? (!NILP (Vface_remapping_alist)
1365 : INTERNAL_BORDER_FACE_ID; 1369 ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID)
1370 : CHILD_FRAME_BORDER_FACE_ID)
1371 : (!NILP (Vface_remapping_alist)
1372 ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID)
1373 : INTERNAL_BORDER_FACE_ID));
1366 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); 1374 struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
1367 1375
1368 block_input (); 1376 block_input ();