summaryrefslogtreecommitdiff
path: root/src/nsfns.m
diff options
context:
space:
mode:
authorAlexander Miller <alexanderm@web.de>2021-01-26 10:36:52 +0100
committerMartin Rudalics <rudalics@gmx.at>2021-01-26 10:36:52 +0100
commitff7b1a133bfa7f2614650f8551824ffaef13fadc (patch)
tree0314a68f16b478f5537a28395c55e15f82b01876 /src/nsfns.m
parentb4b6a2684062d4470143b6ea460b5e82012554a1 (diff)
downloademacs-ff7b1a133bfa7f2614650f8551824ffaef13fadc.tar.gz
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/nsfns.m')
-rw-r--r--src/nsfns.m19
1 files changed, 19 insertions, 0 deletions
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)
}
}
+static void
+ns_set_child_frame_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+ int old_width = FRAME_CHILD_FRAME_BORDER_WIDTH (f);
+ int new_width = check_int_nonnegative (arg);
+
+ if (new_width == old_width)
+ return;
+ f->child_frame_border_width = new_width;
+
+ if (FRAME_NATIVE_WINDOW (f) != 0)
+ adjust_frame_size (f, -1, -1, 3, 0, Qchild_frame_border_width);
+
+ SET_FRAME_GARBAGED (f);
+}
static void
ns_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
@@ -912,6 +927,7 @@ frame_parm_handler ns_frame_parm_handlers[] =
ns_set_foreground_color,
ns_set_icon_name,
ns_set_icon_type,
+ ns_set_child_frame_border_width,
ns_set_internal_border_width,
gui_set_right_divider_width, /* generic OK */
gui_set_bottom_divider_width, /* generic OK */
@@ -1197,6 +1213,9 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
"internalBorderWidth", "InternalBorderWidth",
RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qchild_frame_border_width, make_fixnum (2),
+ "childFrameBorderWidth", "childFrameBorderWidth",
+ RES_TYPE_NUMBER);
gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
NULL, NULL, RES_TYPE_NUMBER);
gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),