Re: [AC21.4] New frames not displayed correctly if buffer tabs off

Mike Alexander <[email protected]>
Newsgroups gmane.emacs.xemacs.windows
Message-ID <192532984.1048114234@[172.27.6.114]>
How about 21.5?  Has it been committed there?  I don't think it has, shall 
I?  This patch is fine for 21.4, but I don't think the problem it fixes 
shows up there.

                        Mike

--On Wednesday, March 19, 2003 10:43 PM -0500 Vin Shelton <[email protected]> 
wrote:

> APPROVE COMMIT 21.4
>
> Thanks for the patch.
>
> This will appear in 21.4.13.
>
>   - Vin
>
> Mike Alexander <[email protected]> writes:
>
>> A while back I mentioned [1] that frames other than the initial frame
>> didn't display correctly in the native Windows version of XEmacs.  My
>> analysis of the problem in that message was wrong, but I think I found
>> the actual problem and this patch seems to fix it.
>>
>> The problem is that when the frame is created the main window in the
>> frame is not sized correctly (it ends up being something like 13 by 7
>> pixels). When redisplay_frame is called for the new frame for the first
>> time it calls adjust_frame_size which on Windows eventually winds up in
>> mswindows_set_frame_size.  This method needs to call change_frame_size
>> to cause XEmacs to recalculate the size of the windows in the frame.
>> The problem doesn't show up if buffer tabs are on since the process of
>> computing the tabs causes the window sizes to be recalculated and this
>> happens late enough that the calculations are correct.  You can also
>> make the frame display correctly by resizing it, however slightly.
>> Adding the call to change_frame_size to mswindows_set_frame_size seems
>> correct since that's what gtk_set_frame_size does.
>>
>>
>> [1] http://list-archive.xemacs.org/xemacs-nt/200302/msg00032.html
>>
>> --
>>
>> Mike Alexander                Arbortext, Inc.
>> [email protected]             +1-734-997-0200
>>
>>
>>
>> src/ChangeLog addition:
>>
>> 2003-03-03  Mike Alexander  <[email protected]>
>>
>> 	* frame-msw.c (mswindows_set_frame_size): Call change_frame_size.
>>
>>
>> xemacs source patch:
>> Diff command:   C:/PROGRA~1/GNU/WinCvs~1.3/cvs -q diff -u
>> Files affected: src/frame-msw.c
>>
>> Index: src/frame-msw.c
>> ===================================================================
>> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-msw.c,v
>> retrieving revision 1.51
>> diff -u -u -r1.51 frame-msw.c
>> --- src/frame-msw.c	2003/02/21 06:56:57	1.51
>> +++ src/frame-msw.c	2003/03/03 08:56:55
>> @@ -337,9 +337,14 @@
>>  mswindows_set_frame_size (struct frame *f, int width, int height)
>>  {
>>    RECT rect;
>> +  int columns, rows;
>> +
>>    rect.left = rect.top = 0;
>>    rect.right = width;
>>    rect.bottom = height;
>> +
>> +  pixel_to_char_size (f, rect.right, rect.bottom, &columns, &rows);
>> +  change_frame_size (f, rows, columns, 0);
>>
>>    /* This can call Lisp, because it runs the window procedure, which
>>    can call redisplay() */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.