diff options
author | Martin Rudalics <rudalics@gmx.at> | 2021-02-06 18:22:29 +0100 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2021-02-06 18:22:29 +0100 |
commit | 29e9cf291eb35a77ad782e56effddf2fa00ee96c (patch) | |
tree | 24af9288415937b1ef1cfef2fa40de7cb8a800ef /src/frame.c | |
parent | c0d504eb7e0922be9f9ec6d9b7f1a27c5fc31b33 (diff) | |
download | emacs-29e9cf291eb35a77ad782e56effddf2fa00ee96c.tar.gz emacs-29e9cf291eb35a77ad782e56effddf2fa00ee96c.tar.bz2 emacs-29e9cf291eb35a77ad782e56effddf2fa00ee96c.zip |
Permit zero value for 'child-frame-border-width' parameter (Bug#46184)
* doc/lispref/frames.texi (Layout Parameters): Update entry on
'child-frame-border-width' parameter.
* src/frame.c (make_frame): Init child_frame_border_width to -1.
(Fframe_child_frame_border_width): Return internal border width if
child frame border width parameter is nil.
(gui_report_frame_params): Report nil as child frame border
width parameter if the frame value is negative.
* src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Return value of
child frame border width only if it is not negative.
* src/xfns.c (Fx_create_frame): Default child frame border to -1
when recording it in its frame slot via gui_default_parameter.
* src/nsfns.m (ns_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/w32fns.c (w32_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/xfns.c (x_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
Diffstat (limited to 'src/frame.c')
-rw-r--r-- | src/frame.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/frame.c b/src/frame.c index a2167ce1e49..635fc945604 100644 --- a/src/frame.c +++ b/src/frame.c @@ -898,6 +898,7 @@ make_frame (bool mini_p) f->no_accept_focus = false; f->z_group = z_group_none; f->tooltip = false; + f->child_frame_border_width = -1; f->last_tab_bar_item = -1; #ifndef HAVE_EXT_TOOL_BAR f->last_tool_bar_item = -1; @@ -3544,10 +3545,17 @@ DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0, } DEFUN ("frame-child-frame-border-width", Fframe_child_frame_border_width, Sframe_child_frame_border_width, 0, 1, 0, - doc: /* Return width of FRAME's child-frame border in pixels. */) + doc: /* Return width of FRAME's child-frame border in pixels. + If FRAME's 'child-frame-border-width' parameter is nil, return FRAME's + internal border width instead. */) (Lisp_Object frame) { - return make_fixnum (FRAME_CHILD_FRAME_BORDER_WIDTH (decode_any_frame (frame))); + int width = FRAME_CHILD_FRAME_BORDER_WIDTH (decode_any_frame (frame)); + + if (width < 0) + return make_fixnum (FRAME_INTERNAL_BORDER_WIDTH (decode_any_frame (frame))); + else + return make_fixnum (FRAME_CHILD_FRAME_BORDER_WIDTH (decode_any_frame (frame))); } DEFUN ("frame-internal-border-width", Fframe_internal_border_width, Sframe_internal_border_width, 0, 1, 0, @@ -4311,7 +4319,9 @@ gui_report_frame_params (struct frame *f, Lisp_Object *alistptr) store_in_alist (alistptr, Qborder_width, make_fixnum (f->border_width)); store_in_alist (alistptr, Qchild_frame_border_width, - make_fixnum (FRAME_CHILD_FRAME_BORDER_WIDTH (f))); + FRAME_CHILD_FRAME_BORDER_WIDTH (f) >= 0 + ? make_fixnum (FRAME_CHILD_FRAME_BORDER_WIDTH (f)) + : Qnil); store_in_alist (alistptr, Qinternal_border_width, make_fixnum (FRAME_INTERNAL_BORDER_WIDTH (f))); store_in_alist (alistptr, Qright_divider_width, |