Subject: Re: bug#52697: 29.0.50; pgtk: wrong initial frame parameter values

From: Stephen Berman <[email-masked]>
Date: Tue, 08 Feb 2022 13:48:49 +0100

On Tue, 08 Feb 2022 19:57:56 +0800 Po Lu <[email-masked]> wrote:

> Stephen Berman <[email-masked]> writes:
>
>> With Emacs built from master without pgtk, I start with -Q and evaluate
>> the following sexps, yielding the results shown:
>>
>> (alist-get 'left (frame-parameters))
>> 939
>>
>> (alist-get 'top (frame-parameters))
>> 371
>>
>> With Emacs built from master with pgtk, I start with -Q and evaluate
>> the same sexps, yielding the following results:
>>
>> (alist-get 'left (frame-parameters))
>> 0
>>
>> (alist-get 'top (frame-parameters))
>> 0
>>
>> The results in the non-pgtk build are correct: the frame is in the
>> middle of the screen, not in the upper left corner.  This is with Xfce
>> and the xfwm4 window manager.
>
> Thanks, should be fixed now on master.

Thanks very much, I confirm your patch essentially fixes the bug, except
for mistakenly switching the top and left parameters:

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index e9fd5f83b7..8faffe94d4 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -5552,7 +5552,7 @@ configure_event (GtkWidget *widget,

       if (f->win_gravity == NorthWestGravity)
 	gtk_window_get_position (GTK_WINDOW (widget),
-				 &f->top_pos, &f->left_pos);
+				 &f->left_pos, &f->top_pos);
       else
 	{
 	  f->top_pos = event->configure.y;

Steve Berman