GNU bug report logs - #76190
31.0.50; Setting frame parameter 'left (- -N) broken

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Tue, 11 Feb 2025 02:05:01 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Po Lu <luangruo <at> yahoo.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii <eliz <at> gnu.org>, 76190 <at> debbugs.gnu.org
Subject: bug#76190: 31.0.50; Setting frame parameter 'left (- -N) broken
Date: Wed, 12 Feb 2025 09:35:57 +0800
martin rudalics <rudalics <at> gmx.at> writes:

>>> according to (info "(elisp) Position Parameters"),
>>>
>>>    (set-frame-parameter nil 'left '(- -100))
>>>
>>> should move the selected frame to the right so a small part (100 pixels)
>>> is moved outside of the current screen, and the rest is visible on the
>>> right side.  However, for me the effect is exactly the same as with
>>> (set-frame-parameter nil 'left +100).  A totally different result!  I'm
>>> quite sure that this worked for me as described a while ago.  Something
>>> has changed.  I did not change my system setup AFAICT, still Openbox on
>>> X, same monitor setup, same Notebook, same OS.
>>>
>>> Other values do work as described.  In particular do (+ -N) and
>>> (+ +N) work as described (the latter case is similar to the broken one
>>> but works for me).
>>>
>>> Can others reproduce this?
>>
>> I can't (on MS-Windows): the original example works for me as you
>> expected.
>
> I attached a patch.  Can you try it Michael?
>
> martin
>
> diff --git a/src/xterm.c b/src/xterm.c
> index 0a877e9edf9..962166f3d3e 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -27512,7 +27512,7 @@ x_calc_absolute_position (struct frame *f)
>  
>    /* Treat negative positions as relative to the leftmost bottommost
>       position that fits on the screen.  */
> -  if ((flags & XNegative) && (f->left_pos <= 0))
> +  if (flags & XNegative)
>      {
>        int width = FRAME_PIXEL_WIDTH (f);
>  
> @@ -27539,7 +27539,7 @@ x_calc_absolute_position (struct frame *f)
>  
>      }
>  
> -  if ((flags & YNegative) && (f->top_pos <= 0))
> +  if (flags & YNegative)
>      {
>        int height = FRAME_PIXEL_HEIGHT (f);
>  

This and the documented behavior in the maual doesn't appear correct to
me, as XParseGeometry returns a negative value if XNegative is set.
Hence f->left_pos is meant always to be negative if (flags & XNegative),
and after all, "=100x100--100+0" is not a valid geometry string.




This bug report was last modified 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.