Subject: bug#13065: closed (Re: bug#13065: Bug in x-file-dialog with GetOpenFileName)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 22 Jan 2013 13:34:02 +0000

Your bug report

#13065: Bug in x-file-dialog with GetOpenFileName

which was filed against the emacs,w32 package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
13065: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13065
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#13065: Bug in x-file-dialog with GetOpenFileName
From: Eli Zaretskii <[email-masked]>
To: [email-masked], [email-masked]
Cc: [email-masked]
Date: Tue, 22 Jan 2013 15:32:41 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Wed, 16 Jan 2013 20:54:05 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> So, unless someone has a better idea, I will soon commit to the
> emacs-24 branch the patch shown below.  It fixes the problem on
> Windows 7 and does not affect XP in any visible way.  The initial
> amount of memory to reserve was found by trial and error.
> 
> (After this patch, the original recipe still doesn't work: you need to
> type "abc" _after_ clicking "Desktop".  But the same happens with
> Emacs 23, so I guess this is just a minor change in behavior of
> Windows 7.)
> 
> === modified file 'src/w32heap.c'
> --- src/w32heap.c	2013-01-01 09:11:05 +0000
> +++ src/w32heap.c	2013-01-16 18:34:38 +0000
> @@ -98,7 +98,11 @@ allocate_heap (void)
>  #ifdef _WIN64
>    size_t size = 0x4000000000i64; /* start by asking for 32GB */
>  #else
> -  size_t size = 0x80000000; /* start by asking for 2GB */
> +  /* We used to start with 2GB here, but on Windows 7 that would leave
> +     too little room in the address space for threads started by
> +     Windows on our behalf, e.g. when we pop up the file selection
> +     dialog.  */
> +  size_t size = 0x68000000; /* start by asking for 1.7GB */
>  #endif
>    void *ptr = NULL;

No further comments, so I committed this to the emacs-24 branch
(revision 111192), and I'm closing this bug report.

Subject: Bug in x-file-dialog with GetOpenFileName
From: Du Yanning <[email-masked]>
To: [email-masked]
Date: Mon, 3 Dec 2012 19:09:49 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Platform: Windows 7
Emacs version: 24.2.1

Steps to reproduce this bug:
emacs -Q

copy and paste the next line into the *scratch* buffer:
(x-file-dialog "hi" "c:\\")

C-x C-e to evaluate it.
The dialog appears.

Type "abc" (without the enclosing double quotes) in the "File name" field.
Click the "Desktop" icon on the left side of the dialog.
Click the "Open" button.
The dialog does NOT disappear while it should.

I have tried GetOpenFileName/GetSaveFileName in my own Win32 programs and
found that this behavior is casued by GetOpenFileName and GetSaveFileName
is OK in such situation. However, simply replacing GetOpenFileName with
GetSaveFileName will break other code in x-file-dialog.