Subject: Re: bug#76190: 31.0.50; Setting frame parameter 'left (- -N) broken

From: martin rudalics <[email-masked]>
Date: Tue, 11 Feb 2025 16:38:39 +0100

>> 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);