Subject: Re: bug#1348: set-frame-width and set-frame-position seem buggy on at least MSWindows

From: martin rudalics <[email-masked]>
Date: Tue, 18 Nov 2008 14:03:27 +0100

>>> When migrating to Emacs 22.3.1 on microsoft windows, the following
 >>> lines in my .emacs file do not behave as expected:
 >
 >>>   (set-frame-position (selected-frame) 0 0)
 >>>   (sleep-for 2) ; not originally in my .emacs -- testing only
 >>>   (set-frame-width (selected-frame) 150)
 >>>   (sleep-for 2)
 >>>   (set-frame-height (selected-frame) 55)
 >>>   (sleep-for 2))
[...]
 > 1. The bug is present in 22.2
 > 2. (set-frame-size) is not affected, and is probably a better work-around
 > than I gave in my previous message.

Interesting.  Does the attached patch give better results?

martin
*** dispnew.c.~1.424.~	2008-10-28 07:22:51.656250000 +0100
--- dispnew.c	2008-11-18 13:57:27.546875000 +0100
***************
*** 6305,6310 ****
--- 6305,6316 ----
    int new_frame_total_cols;
    int count = SPECPDL_INDEX ();
  
+   /* If an argument is zero, set it to the current value.  */
+   if (newheight == 0)
+     newheight = FRAME_LINES (f);
+   if (newwidth == 0)
+     newwidth  = FRAME_COLS  (f);
+ 
    /* If we can't deal with the change now, queue it for later.  */
    if (delay || (redisplaying_p && !safe))
      {
***************
*** 6318,6329 ****
    f->new_text_lines = 0;
    f->new_text_cols = 0;
  
-   /* If an argument is zero, set it to the current value.  */
-   if (newheight == 0)
-     newheight = FRAME_LINES (f);
-   if (newwidth == 0)
-     newwidth  = FRAME_COLS  (f);
- 
    /* Compute width of windows in F.
       This is the width of the frame without vertical scroll bars.  */
    new_frame_total_cols = FRAME_TOTAL_COLS_ARG (f, newwidth);
--- 6324,6329 ----