all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#55588: pgtk: child-frame-border-width cannot be set to nil
@ 2022-05-22 22:03 Florian Rommel
  2022-05-23  4:18 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Rommel @ 2022-05-22 22:03 UTC (permalink / raw)
  To: 55588

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

In pgtk, child-frame-border-width is set to 0 by default, and it cannot
be set to nil.
According to the manual it should be possible for child-frame-border-
width to be nil. In such cases, the value of internal-border-width is
used as the border width (see 30.4.3.4 "Layout Parameters"; and
function FRAME_INTERNAL_BORDER_WIDTH in frame.h).

The problem causes missing child-frame borders for code that depends on
this behavior (e.g., lsp-doc-ui in the lsp-ui package), and it will
cause errors for code that tries to set child-frame-border-width to
nil.

The attached patch fixes this. It essentially replicates the respective
behavior of xfns.c.


[-- Attachment #2: 0001-pgtk-Allow-child-frame-border-width-to-be-nil.patch --]
[-- Type: text/x-patch, Size: 1543 bytes --]

From 05479840c12174baa8b1de61c80156ee7d56dd38 Mon Sep 17 00:00:00 2001
From: Florian Rommel <mail@florommel.de>
Date: Sun, 22 May 2022 23:30:52 +0200
Subject: [PATCH] pgtk: Allow child-frame-border-width to be nil

* src/pgtkfns.c (pgtk_set_child_frame_border_width, x-create-frame):
Allow child-frame-border-width to be set to nil, and set its default
value to nil.

Copyright-paperwork-exempt: yes
---
 src/pgtkfns.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 1feb3fe250..0764e4a2d5 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -566,7 +566,14 @@ pgtk_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 static void
 pgtk_set_child_frame_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
-  int border = check_int_nonnegative (arg);
+  int border;
+
+  if (NILP (arg))
+    border = -1;
+  else if (RANGED_FIXNUMP (0, arg, INT_MAX))
+    border = XFIXNAT (arg);
+  else
+    signal_error ("Invalid child frame border width", arg);
 
   if (border != FRAME_CHILD_FRAME_BORDER_WIDTH (f))
     {
@@ -1429,8 +1436,7 @@ This function is an internal primitive--use `make-frame' instead.  */ )
 
     }
 
-  gui_default_parameter (f, parms, Qchild_frame_border_width,
-			 make_fixnum (0),
+  gui_default_parameter (f, parms, Qchild_frame_border_width, Qnil,
 			 "childFrameBorderWidth", "childFrameBorderWidth",
 			 RES_TYPE_NUMBER);
   gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#55588: pgtk: child-frame-border-width cannot be set to nil
  2022-05-22 22:03 bug#55588: pgtk: child-frame-border-width cannot be set to nil Florian Rommel
@ 2022-05-23  4:18 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-05-23  5:31   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-05-23  4:18 UTC (permalink / raw)
  To: Florian Rommel; +Cc: 55588

Florian Rommel <mail@florommel.de> writes:

> In pgtk, child-frame-border-width is set to 0 by default, and it cannot
> be set to nil.
> According to the manual it should be possible for child-frame-border-
> width to be nil. In such cases, the value of internal-border-width is
> used as the border width (see 30.4.3.4 "Layout Parameters"; and
> function FRAME_INTERNAL_BORDER_WIDTH in frame.h).
>
> The problem causes missing child-frame borders for code that depends on
> this behavior (e.g., lsp-doc-ui in the lsp-ui package), and it will
> cause errors for code that tries to set child-frame-border-width to
> nil.
>
> The attached patch fixes this. It essentially replicates the respective
> behavior of xfns.c.

I remember there was a reason internal (and child frame) borders don't
work quite right in child frames on PGTK.  That might've been fixed in
December, but I cannot remember.

Please let me look into this first.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55588: pgtk: child-frame-border-width cannot be set to nil
  2022-05-23  4:18 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-05-23  5:31   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-05-23  9:38     ` Florian Rommel
  0 siblings, 1 reply; 6+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-05-23  5:31 UTC (permalink / raw)
  To: Florian Rommel; +Cc: 55588

Po Lu <luangruo@yahoo.com> writes:

> I remember there was a reason internal (and child frame) borders don't
> work quite right in child frames on PGTK.  That might've been fixed in
> December, but I cannot remember.

It was fixed in December.  I installed a similar change along with some
other fixes to child frames on PGTK, please test.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55588: pgtk: child-frame-border-width cannot be set to nil
  2022-05-23  5:31   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-05-23  9:38     ` Florian Rommel
  2022-05-23 12:15       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Rommel @ 2022-05-23  9:38 UTC (permalink / raw)
  To: Po Lu; +Cc: 55588

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

On Mon, 2022-05-23 at 13:31 +0800, Po Lu wrote:
> It was fixed in December.  I installed a similar change along with
> some
> other fixes to child frames on PGTK, please test.

Thanks! Almost works.
I believe that the default value of child-frame-border-width should be
nil (that's the case for xfns and others), with this everything works
as expected for me.


[-- Attachment #2: 0001-pgtk-Set-child-frame-border-width-to-nil.patch --]
[-- Type: text/x-patch, Size: 895 bytes --]

From 329ddb7c4e27836cdf26b9d530eae4399c391dac Mon Sep 17 00:00:00 2001
From: Florian Rommel <mail@florommel.de>
Date: Mon, 23 May 2022 11:17:48 +0200
Subject: [PATCH] pgtk: Set child-frame-border-width to nil

* src/pgtkfns.c (x-create-frame)

Copyright-paperwork-exempt: yes
---
 src/pgtkfns.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index b26709d90c..35e3c10589 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -1437,8 +1437,7 @@ This function is an internal primitive--use `make-frame' instead.  */ )
 
     }
 
-  gui_default_parameter (f, parms, Qchild_frame_border_width,
-			 make_fixnum (0),
+  gui_default_parameter (f, parms, Qchild_frame_border_width, Qnil,
 			 "childFrameBorderWidth", "childFrameBorderWidth",
 			 RES_TYPE_NUMBER);
   gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#55588: pgtk: child-frame-border-width cannot be set to nil
  2022-05-23  9:38     ` Florian Rommel
@ 2022-05-23 12:15       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-21 11:45         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-05-23 12:15 UTC (permalink / raw)
  To: Florian Rommel; +Cc: 55588

Florian Rommel <mail@florommel.de> writes:

> On Mon, 2022-05-23 at 13:31 +0800, Po Lu wrote:
>> It was fixed in December.  I installed a similar change along with
>> some
>> other fixes to child frames on PGTK, please test.
>
> Thanks! Almost works.
> I believe that the default value of child-frame-border-width should be
> nil (that's the case for xfns and others), with this everything works
> as expected for me.

Should be fixed now as well, thanks.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#55588: pgtk: child-frame-border-width cannot be set to nil
  2022-05-23 12:15       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-21 11:45         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-21 11:45 UTC (permalink / raw)
  To: Po Lu; +Cc: Florian Rommel, 55588

Po Lu <luangruo@yahoo.com> writes:

>> Thanks! Almost works.
>> I believe that the default value of child-frame-border-width should be
>> nil (that's the case for xfns and others), with this everything works
>> as expected for me.
>
> Should be fixed now as well, thanks.

This was a month ago, so I assume Po's fix worked, and I'm therefore
closing this bug report.  If this is still an issue, please respond to
the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-21 11:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-22 22:03 bug#55588: pgtk: child-frame-border-width cannot be set to nil Florian Rommel
2022-05-23  4:18 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-23  5:31   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-23  9:38     ` Florian Rommel
2022-05-23 12:15       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-21 11:45         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.