GNU bug report logs -
#74312
31.0.50; Cygw32 build break
Previous Next
Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Date: Mon, 11 Nov 2024 14:52:01 UTC
Severity: normal
Found in version 31.0.50
Done: Ken Brown <kbrown <at> cornell.edu>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74312 in the body.
You can then email your comments to 74312 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Mon, 11 Nov 2024 14:52:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 11 Nov 2024 14:52:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Cygw32 build fails on master
$ make
(snip)
CC w32fns.o
../../../emacs/src/w32fns.c: In function ‘process_dropfiles’:
../../../emacs/src/w32fns.c:2549:17: error: ‘MAX_UTF8_PATH’ undeclared (first use in this function); did you mean ‘MAX_ZONE_PATH’?
2549 | char filename[MAX_UTF8_PATH];
| ^~~~~~~~~~~~~
| MAX_ZONE_PATH
../../../emacs/src/w32fns.c:2549:17: note: each undeclared identifier is reported only once for each function it appears in
../../../emacs/src/w32fns.c:2557:11: warning: implicit declaration of function ‘filename_from_utf16’ [-Wimplicit-function-declaration]
2557 | filename_from_utf16 (p, filename);
| ^~~~~~~~~~~~~~~~~~~
../../../emacs/src/w32fns.c:2557:11: warning: nested extern declaration of ‘filename_from_utf16’ [-Wnested-externs]
../../../emacs/src/w32fns.c:2567:11: warning: implicit declaration of function ‘gifilename_from_ansi’ [-Wimplicit-function-declaration]
2567 | filename_from_ansi (p, filename);
| ^~~~~~~~~~~~~~~~~~
../../../emacs/src/w32fns.c:2567:11: warning: nested extern declaration of ‘filename_from_ansi’ [-Wnested-externs]
../../../emacs/src/w32fns.c:2549:8: warning: unused variable ‘filename’ [-Wunused-variable]
2549 | char filename[MAX_UTF8_PATH];
| ^~~~~~~~
make[2]: *** [Makefile:457: w32fns.o] Error 1
MAX_UTF8_PATH is defined in nt/inc/ms-w32.h and filename_from_*
functions are defined in src/w32.c
--
Kazuhiro Ito
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Mon, 11 Nov 2024 16:10:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> Date: Mon, 11 Nov 2024 23:51:33 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
>
> Cygw32 build fails on master
Thanks, I've tried to fix it, please see if there are other problems.
And when it does build, please try the drag-n-drop feature, both with
dropping files and with dropping text on Emacs.
(I repeatedly asked Ken to test these changes with the Cygwin build,
but I guess he didn't yet have time. So it's small wonder that the
master branch fails to build on Cygwin.)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Mon, 11 Nov 2024 18:09:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 74312 <at> debbugs.gnu.org (full text, mbox):
On 11/11/2024 11:07 AM, Eli Zaretskii wrote:
>> Date: Mon, 11 Nov 2024 23:51:33 +0900
>> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
>>
>> Cygw32 build fails on master
>
> Thanks, I've tried to fix it, please see if there are other problems.
> And when it does build, please try the drag-n-drop feature, both with
> dropping files and with dropping text on Emacs.
>
> (I repeatedly asked Ken to test these changes with the Cygwin build,
> but I guess he didn't yet have time. So it's small wonder that the
> master branch fails to build on Cygwin.)
I'm sorry, but I somehow missed your requests. I'll try to look at this
within the next few days if Kazuhiro doesn't beat me to it.
Ken
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Mon, 11 Nov 2024 20:14:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> Date: Mon, 11 Nov 2024 13:08:13 -0500
> Cc: 74312 <at> debbugs.gnu.org
> From: Ken Brown <kbrown <at> cornell.edu>
>
> On 11/11/2024 11:07 AM, Eli Zaretskii wrote:
> >> Date: Mon, 11 Nov 2024 23:51:33 +0900
> >> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> >>
> >> Cygw32 build fails on master
> >
> > Thanks, I've tried to fix it, please see if there are other problems.
> > And when it does build, please try the drag-n-drop feature, both with
> > dropping files and with dropping text on Emacs.
> >
> > (I repeatedly asked Ken to test these changes with the Cygwin build,
> > but I guess he didn't yet have time. So it's small wonder that the
> > master branch fails to build on Cygwin.)
>
> I'm sorry, but I somehow missed your requests. I'll try to look at this
> within the next few days if Kazuhiro doesn't beat me to it.
Thanks, much appreciated.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Mon, 11 Nov 2024 22:52:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 74312 <at> debbugs.gnu.org (full text, mbox):
On 11/11/2024 3:13 PM, Eli Zaretskii wrote:
>> Date: Mon, 11 Nov 2024 13:08:13 -0500
>> Cc: 74312 <at> debbugs.gnu.org
>> From: Ken Brown <kbrown <at> cornell.edu>
>>
>> On 11/11/2024 11:07 AM, Eli Zaretskii wrote:
>>>> Date: Mon, 11 Nov 2024 23:51:33 +0900
>>>> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
>>>>
>>>> Cygw32 build fails on master
>>>
>>> Thanks, I've tried to fix it, please see if there are other problems.
>>> And when it does build, please try the drag-n-drop feature, both with
>>> dropping files and with dropping text on Emacs.
>>>
>>> (I repeatedly asked Ken to test these changes with the Cygwin build,
>>> but I guess he didn't yet have time. So it's small wonder that the
>>> master branch fails to build on Cygwin.)
>>
>> I'm sorry, but I somehow missed your requests. I'll try to look at this
>> within the next few days if Kazuhiro doesn't beat me to it.
>
> Thanks, much appreciated.
The build still fails:
In function ‘dump_mm_heap_cb_release’,
inlined from ‘dump_mmap_contiguous_heap’ at ../../src/pdumper.c:4919:3,
inlined from ‘dump_mmap_contiguous’ at ../../src/pdumper.c:5064:50,
inlined from ‘pdumper_load’ at ../../src/pdumper.c:5765:8:
../../src/pdumper.c:4857:11: warning: null pointer dereference
[-Wnull-dereference]
4857 | if (--cb->refcount == 0)
| ~~^~~~~~~~~~
../../src/pdumper.c:4857:6: warning: null pointer dereference
[-Wnull-dereference]
4857 | if (--cb->refcount == 0)
| ^
In file included from ../../src/pdumper.c:26:
In function ‘dump_mm_heap_cb_release’,
inlined from ‘dump_mm_heap_cb_release’ at ../../src/pdumper.c:4854:1,
inlined from ‘dump_mmap_contiguous_heap’ at ../../src/pdumper.c:4919:3,
inlined from ‘dump_mmap_contiguous’ at ../../src/pdumper.c:5064:50,
inlined from ‘pdumper_load’ at ../../src/pdumper.c:5765:8:
../../src/pdumper.c:4859:7: warning: null pointer dereference
[-Wnull-dereference]
4859 | free (cb->mem);
| ^
../../src/w32menu.c: In function ‘w32_popup_dialog’:
../../src/w32menu.c:200:21: warning: implicit declaration of function
‘pMultiByteToWideChar’; did you mean ‘MultiByteToWideChar’?
[-Wimplicit-function-declaration]
200 | * pMultiByteToWideChar (CP_UTF8, 0, title,
-1, NULL, 0));
| ^~~~~~~~~~~~~~~~~~~~
| MultiByteToWideChar
../../src/w32menu.c:200:21: warning: nested extern declaration of
‘pMultiByteToWideChar’ [-Wnested-externs]
../../src/w32dwrite.c:41: warning: macro "INITGUID" is not used
[-Wunused-macros]
41 | # define INITGUID
|
../../src/w32dwrite.c: In function ‘w32_dwrite_encode_char’:
../../src/w32dwrite.c:662:51: warning: pointer targets in passing
argument 2 of ‘dwrite_font_face->lpVtbl->GetGlyphIndicesA’ differ in
signedness [-Wpointer-sign]
662 | &c, 1, &index);
| ^~
| |
| int *
../../src/w32dwrite.c:662:51: note: expected ‘const UINT32 *’ {aka
‘const unsigned int *’} but argument is of type ‘int *’
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
w32menu.o: in function `w32_popup_dialog':
/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:200:(.text+0xb6a):
undefined reference to `pMultiByteToWideChar'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:202:(.text+0xba5):
undefined reference to `pMultiByteToWideChar'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:252:(.text+0xc1e):
undefined reference to `pMultiByteToWideChar'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:256:(.text+0xc6a):
undefined reference to `pMultiByteToWideChar'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:230:(.text+0xdfe):
undefined reference to `pMultiByteToWideChar'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
w32menu.o:/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:233:
more undefined references to `pMultiByteToWideChar' follow
I don't have time right now to look into the reasons for these errors
and warnings, but, again, I'll try to do that within a few days if no
one beats me to it.
Ken
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Tue, 12 Nov 2024 12:43:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> Date: Mon, 11 Nov 2024 17:50:47 -0500
> Cc: kzhr <at> d1.dion.ne.jp, 74312 <at> debbugs.gnu.org
> From: Ken Brown <kbrown <at> cornell.edu>
>
> The build still fails:
>
> In function ‘dump_mm_heap_cb_release’,
> inlined from ‘dump_mmap_contiguous_heap’ at ../../src/pdumper.c:4919:3,
> inlined from ‘dump_mmap_contiguous’ at ../../src/pdumper.c:5064:50,
> inlined from ‘pdumper_load’ at ../../src/pdumper.c:5765:8:
> ../../src/pdumper.c:4857:11: warning: null pointer dereference
> [-Wnull-dereference]
> 4857 | if (--cb->refcount == 0)
> | ~~^~~~~~~~~~
> ../../src/pdumper.c:4857:6: warning: null pointer dereference
> [-Wnull-dereference]
> 4857 | if (--cb->refcount == 0)
> | ^
> In file included from ../../src/pdumper.c:26:
> In function ‘dump_mm_heap_cb_release’,
> inlined from ‘dump_mm_heap_cb_release’ at ../../src/pdumper.c:4854:1,
> inlined from ‘dump_mmap_contiguous_heap’ at ../../src/pdumper.c:4919:3,
> inlined from ‘dump_mmap_contiguous’ at ../../src/pdumper.c:5064:50,
> inlined from ‘pdumper_load’ at ../../src/pdumper.c:5765:8:
> ../../src/pdumper.c:4859:7: warning: null pointer dereference
> [-Wnull-dereference]
> 4859 | free (cb->mem);
> | ^
>
> ../../src/w32menu.c: In function ‘w32_popup_dialog’:
> ../../src/w32menu.c:200:21: warning: implicit declaration of function
> ‘pMultiByteToWideChar’; did you mean ‘MultiByteToWideChar’?
> [-Wimplicit-function-declaration]
> 200 | * pMultiByteToWideChar (CP_UTF8, 0, title,
> -1, NULL, 0));
> | ^~~~~~~~~~~~~~~~~~~~
> | MultiByteToWideChar
> ../../src/w32menu.c:200:21: warning: nested extern declaration of
> ‘pMultiByteToWideChar’ [-Wnested-externs]
>
> ../../src/w32dwrite.c:41: warning: macro "INITGUID" is not used
> [-Wunused-macros]
> 41 | # define INITGUID
> |
> ../../src/w32dwrite.c: In function ‘w32_dwrite_encode_char’:
> ../../src/w32dwrite.c:662:51: warning: pointer targets in passing
> argument 2 of ‘dwrite_font_face->lpVtbl->GetGlyphIndicesA’ differ in
> signedness [-Wpointer-sign]
> 662 | &c, 1, &index);
> | ^~
> | |
> | int *
> ../../src/w32dwrite.c:662:51: note: expected ‘const UINT32 *’ {aka
> ‘const unsigned int *’} but argument is of type ‘int *’
>
> /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> w32menu.o: in function `w32_popup_dialog':
> /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:200:(.text+0xb6a):
> undefined reference to `pMultiByteToWideChar'
> /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:202:(.text+0xba5):
> undefined reference to `pMultiByteToWideChar'
> /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:252:(.text+0xc1e):
> undefined reference to `pMultiByteToWideChar'
> /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:256:(.text+0xc6a):
> undefined reference to `pMultiByteToWideChar'
> /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:230:(.text+0xdfe):
> undefined reference to `pMultiByteToWideChar'
> /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> w32menu.o:/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:233:
> more undefined references to `pMultiByteToWideChar' follow
>
> I don't have time right now to look into the reasons for these errors
> and warnings, but, again, I'll try to do that within a few days if no
> one beats me to it.
Thanks, I tried to fix those.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Tue, 12 Nov 2024 16:16:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> > ../../src/w32menu.c: In function ‘w32_popup_dialog’:
> > ../../src/w32menu.c:200:21: warning: implicit declaration of function
> > ‘pMultiByteToWideChar’; did you mean ‘MultiByteToWideChar’?
> > [-Wimplicit-function-declaration]
> > 200 | * pMultiByteToWideChar (CP_UTF8, 0, title,
> > -1, NULL, 0));
> > | ^~~~~~~~~~~~~~~~~~~~
> > | MultiByteToWideChar
> > ../../src/w32menu.c:200:21: warning: nested extern declaration of
> > ‘pMultiByteToWideChar’ [-Wnested-externs]
> >
> > ../../src/w32dwrite.c:41: warning: macro "INITGUID" is not used
> > [-Wunused-macros]
> > 41 | # define INITGUID
> > |
> > ../../src/w32dwrite.c: In function ‘w32_dwrite_encode_char’:
> > ../../src/w32dwrite.c:662:51: warning: pointer targets in passing
> > argument 2 of ‘dwrite_font_face->lpVtbl->GetGlyphIndicesA’ differ in
> > signedness [-Wpointer-sign]
> > 662 | &c, 1, &index);
> > | ^~
> > | |
> > | int *
> > ../../src/w32dwrite.c:662:51: note: expected ‘const UINT32 *’ {aka
> > ‘const unsigned int *’} but argument is of type ‘int *’
> >
> > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> > w32menu.o: in function `w32_popup_dialog':
> > /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:200:(.text+0xb6a):
> > undefined reference to `pMultiByteToWideChar'
> > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> > /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:202:(.text+0xba5):
> > undefined reference to `pMultiByteToWideChar'
> > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> > /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:252:(.text+0xc1e):
> > undefined reference to `pMultiByteToWideChar'
> > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> > /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:256:(.text+0xc6a):
> > undefined reference to `pMultiByteToWideChar'
> > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> > /home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:230:(.text+0xdfe):
> > undefined reference to `pMultiByteToWideChar'
> > /usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld:
> > w32menu.o:/home/kbrown/src/emacs/master/build-w32/src/../../src/w32menu.c:233:
> > more undefined references to `pMultiByteToWideChar' follow
>
> Thanks, I tried to fix those.
As far as I tested, modifying your change as below was needed.
diff --git a/src/w32menu.c b/src/w32menu.c
index b5f87ebb42c..e5415b89bcb 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -187,8 +187,8 @@ task_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam,
w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
{
#ifdef NTGUI_UNICODE
- typedef int (WINAPI *WideCharToMultiByte_Proc)(UINT,DWORD,LPCWSTR,int,LPSTR,
- int,LPCSTR,LPBOOL);
+ typedef int (WINAPI *MultiByteToWideChar_Proc)(UINT,DWORD,LPCSTR,int,
+ LPWSTR,int);
static MultiByteToWideChar_Proc pMultiByteToWideChar = MultiByteToWideChar;
#endif /* NTGUI_UNICODE */
check_window_system (f);
> And when it does build, please try the drag-n-drop feature, both with
> dropping files and with dropping text on Emacs.
Dropping multiple files or text works the same as MingW build except
files and directories with non-ascii name. When I dragged such files
in Emacs frame, mouse cursor changed into red NO ENTRY SIGN (U+1F6AB)
and no response for dropping.
--
Kazuhiro Ito
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Tue, 12 Nov 2024 16:48:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 13 Nov 2024 01:14:54 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Ken Brown <kbrown <at> cornell.edu>
>
> > Thanks, I tried to fix those.
>
> As far as I tested, modifying your change as below was needed.
Thanks, installed.
> > And when it does build, please try the drag-n-drop feature, both with
> > dropping files and with dropping text on Emacs.
>
> Dropping multiple files or text works the same as MingW build except
> files and directories with non-ascii name. When I dragged such files
> in Emacs frame, mouse cursor changed into red NO ENTRY SIGN (U+1F6AB)
> and no response for dropping.
I guess I didn't understand how are file names dropped into a Cygwin
program encoded? Are they in UTF-8, per chance? I assumed that in
the Cygw32 build they will be in UTF-16, like for native Windows
programs, but maybe that is wrong? Or maybe we should do something on
Cygwin to announce that we support dropping files?
Did dropping a file or a directory on a Cygw32 Emacs work in previous
versions when the file/directory had a non-ASCII name?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Wed, 13 Nov 2024 11:00:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> > Dropping multiple files or text works the same as MingW build except
> > files and directories with non-ascii name. When I dragged such files
> > in Emacs frame, mouse cursor changed into red NO ENTRY SIGN (U+1F6AB)
> > and no response for dropping.
>
> I guess I didn't understand how are file names dropped into a Cygwin
> program encoded? Are they in UTF-8, per chance? I assumed that in
> the Cygw32 build they will be in UTF-16, like for native Windows
> programs, but maybe that is wrong? Or maybe we should do something on
> Cygwin to announce that we support dropping files?
Ah, sorry, I misinterpretted the result. Cygw32 Emacs can handles
non-ascii filename like as MinGW build.
Both Emacsen may fail to handle dropped files if I do drag-n-drop
files very quickly. I confirmed Microsoft Photo application on
Windows 11. And, once Emacs failed to handle drop event, it keeps
ignoring dropping files or text event.
--
Kazuhiro Ito
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Wed, 13 Nov 2024 12:34:02 GMT)
Full text and
rfc822 format available.
Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):
On 13/11/2024 11:59, Kazuhiro Ito wrote:
> Both Emacsen may fail to handle dropped files if I do drag-n-drop
> files very quickly. I confirmed Microsoft Photo application on
> Windows 11. And, once Emacs failed to handle drop event, it keeps
> ignoring dropping files or text event.
I will look into this.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Wed, 13 Nov 2024 15:56:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> > Both Emacsen may fail to handle dropped files if I do drag-n-drop
> > files very quickly. I confirmed Microsoft Photo application on
> > Windows 11. And, once Emacs failed to handle drop event, it keeps
> > ignoring dropping files or text event.
>
> I will look into this.
As far as I tested, drag-n-drop from Microsoft Photo worked only the
first time. Second operation was ignored. Quick operation may fail
even at the first time. Drag-n-drop from explorer worked expectedly.
--
Kazuhiro Ito
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Thu, 14 Nov 2024 08:57:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 74312 <at> debbugs.gnu.org (full text, mbox):
On 13/11/2024 16:55, Kazuhiro Ito wrote:
>>> Both Emacsen may fail to handle dropped files if I do drag-n-drop
>>> files very quickly. I confirmed Microsoft Photo application on
>>> Windows 11. And, once Emacs failed to handle drop event, it keeps
>>> ignoring dropping files or text event.
>>
>> I will look into this.
>
> As far as I tested, drag-n-drop from Microsoft Photo worked only the
> first time. Second operation was ignored. Quick operation may fail
> even at the first time. Drag-n-drop from explorer worked expectedly.
This should fix the Photo application problem.
I didn't expect ref counting to be needed for this, my bad.
diff --git a/src/w32fns.c b/src/w32fns.c
index 1bd3d5099e2..e2455b9271e 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2562,6 +2562,7 @@ w32_process_dnd_data (int format, void *hGlobal)
/* i_drop_target must be the first member. */
IDropTarget i_drop_target;
HWND hwnd;
+ int ref_count;
};
static HRESULT STDMETHODCALLTYPE
@@ -2573,13 +2574,16 @@ w32_drop_target_QueryInterface (IDropTarget *t,
REFIID ri, void **r)
static ULONG STDMETHODCALLTYPE
w32_drop_target_AddRef (IDropTarget *This)
{
- return 1;
+ struct w32_drop_target *target = (struct w32_drop_target *) This;
+ return ++target->ref_count;
}
static ULONG STDMETHODCALLTYPE
w32_drop_target_Release (IDropTarget *This)
{
struct w32_drop_target *target = (struct w32_drop_target *) This;
+ if (--target->ref_count > 0)
+ return target->ref_count;
free (target->i_drop_target.lpVtbl);
free (target);
return 0;
@@ -2770,6 +2774,7 @@ w32_createwindow (struct frame *f, int *coords)
if (vtbl != NULL)
{
drop_target->hwnd = hwnd;
+ drop_target->ref_count = 0;
drop_target->i_drop_target.lpVtbl = vtbl;
vtbl->QueryInterface = w32_drop_target_QueryInterface;
vtbl->AddRef = w32_drop_target_AddRef;
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Thu, 14 Nov 2024 09:41:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 14 Nov 2024 09:55:56 +0100
> From: Cecilio Pardo <cpardo <at> imayhem.com>
>
> On 13/11/2024 16:55, Kazuhiro Ito wrote:
> >>> Both Emacsen may fail to handle dropped files if I do drag-n-drop
> >>> files very quickly. I confirmed Microsoft Photo application on
> >>> Windows 11. And, once Emacs failed to handle drop event, it keeps
> >>> ignoring dropping files or text event.
> >>
> >> I will look into this.
> >
> > As far as I tested, drag-n-drop from Microsoft Photo worked only the
> > first time. Second operation was ignored. Quick operation may fail
> > even at the first time. Drag-n-drop from explorer worked expectedly.
>
> This should fix the Photo application problem.
>
> I didn't expect ref counting to be needed for this, my bad.
Thanks. Can you tell more about the root cause of the problem and how
it is solved using reference counting?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Thu, 14 Nov 2024 10:06:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 74312 <at> debbugs.gnu.org (full text, mbox):
On 14/11/2024 10:39, Eli Zaretskii wrote:
>> This should fix the Photo application problem.
>>
>> I didn't expect ref counting to be needed for this, my bad.
>
> Thanks. Can you tell more about the root cause of the problem and how
> it is solved using reference counting?
w32_drop_target as a COM interface should implement reference counting
through the methods AddRef and Release.
I didn't implement it (AddRef is a noop, Release frees all always)
because I didn't expect to receive any AddRef calls besides the one we
get when calling RegisterDragDrop.
When dragging files from the Photo application, AddRef and Release are
called. The application itselt in principle does not have access to the
IDropTarget to call this methods. Or maybe I am very wrong here.
In any case, I should have implemented AddRef/Release, and my assumption
was wrong.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Thu, 14 Nov 2024 15:01:01 GMT)
Full text and
rfc822 format available.
Message #47 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> > As far as I tested, drag-n-drop from Microsoft Photo worked only the
> > first time. Second operation was ignored. Quick operation may fail
> > even at the first time. Drag-n-drop from explorer worked expectedly.
>
> This should fix the Photo application problem.
I confirmed the problem was fixed, thank you.
--
Kazuhiro Ito
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Thu, 14 Nov 2024 16:09:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 74312 <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 15 Nov 2024 00:00:40 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> Cc: 74312 <at> debbugs.gnu.org,
> Eli Zaretskii <eliz <at> gnu.org>
>
> > > As far as I tested, drag-n-drop from Microsoft Photo worked only the
> > > first time. Second operation was ignored. Quick operation may fail
> > > even at the first time. Drag-n-drop from explorer worked expectedly.
> >
> > This should fix the Photo application problem.
>
> I confirmed the problem was fixed, thank you.
Thanks for testing, I installed the patch on the master branch.
I'm not closing this bug, to let Ken double-check the latest changes
and see if something else broke Cygwin.
Reply sent
to
Ken Brown <kbrown <at> cornell.edu>
:
You have taken responsibility.
(Fri, 15 Nov 2024 22:22:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
:
bug acknowledged by developer.
(Fri, 15 Nov 2024 22:22:02 GMT)
Full text and
rfc822 format available.
Message #55 received at 74312-done <at> debbugs.gnu.org (full text, mbox):
On 11/14/2024 11:07 AM, Eli Zaretskii wrote:
>> Date: Fri, 15 Nov 2024 00:00:40 +0900
>> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
>> Cc: 74312 <at> debbugs.gnu.org,
>> Eli Zaretskii <eliz <at> gnu.org>
>>
>>>> As far as I tested, drag-n-drop from Microsoft Photo worked only the
>>>> first time. Second operation was ignored. Quick operation may fail
>>>> even at the first time. Drag-n-drop from explorer worked expectedly.
>>>
>>> This should fix the Photo application problem.
>>
>> I confirmed the problem was fixed, thank you.
>
> Thanks for testing, I installed the patch on the master branch.
>
> I'm not closing this bug, to let Ken double-check the latest changes
> and see if something else broke Cygwin.
The Cygwin-w32 build seems fine AFAICT. Closing.
Ken
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74312
; Package
emacs
.
(Sat, 16 Nov 2024 11:05:02 GMT)
Full text and
rfc822 format available.
Message #58 received at 74312-done <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 15 Nov 2024 17:21:21 -0500
> Cc: cpardo <at> imayhem.com, 74312-done <at> debbugs.gnu.org
> From: Ken Brown <kbrown <at> cornell.edu>
>
> On 11/14/2024 11:07 AM, Eli Zaretskii wrote:
> >> Date: Fri, 15 Nov 2024 00:00:40 +0900
> >> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> >> Cc: 74312 <at> debbugs.gnu.org,
> >> Eli Zaretskii <eliz <at> gnu.org>
> >>
> >>>> As far as I tested, drag-n-drop from Microsoft Photo worked only the
> >>>> first time. Second operation was ignored. Quick operation may fail
> >>>> even at the first time. Drag-n-drop from explorer worked expectedly.
> >>>
> >>> This should fix the Photo application problem.
> >>
> >> I confirmed the problem was fixed, thank you.
> >
> > Thanks for testing, I installed the patch on the master branch.
> >
> > I'm not closing this bug, to let Ken double-check the latest changes
> > and see if something else broke Cygwin.
> The Cygwin-w32 build seems fine AFAICT. Closing.
Thanks.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 14 Dec 2024 12:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 280 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.