[wxWidgets/wxWidgets] 948b4f: Guard against re-entering in wxOSX wxDropSource::D...

0 views
Skip to first unread message

VZ

unread,
Dec 13, 2025, 7:09:46 PM12/13/25
to wx-co...@googlegroups.com
Branch: refs/heads/master
Home: https://github.com/wxWidgets/wxWidgets
Commit: 948b4f36bea0fcffda3d2bddb81071f00c7c8866
https://github.com/wxWidgets/wxWidgets/commit/948b4f36bea0fcffda3d2bddb81071f00c7c8866
Author: 徐扬斌 <yb...@coremail.cn>
Date: 2025-12-14 (Sun, 14 Dec 2025)

Changed paths:
M src/osx/cocoa/dnd.mm

Log Message:
-----------
Guard against re-entering in wxOSX wxDropSource::DoDragDrop()

At least when using CEF, repeatedly starting drag-and-drop operation may
result in stack overflow.

Messages processed by CEF are handled when wxEVT_IDLE is triggered and
the problematic scenario is when:

1. Cocoa calls OSXDefaultModeObserverCallBack()
2. wxEVT_IDLE is triggered.
3. wxWebViewChromium::OnIdle() is called.
4. CefDoMessageLoopWork() performs various jobs for CEF.

If DoDragDrop() is invoked during CefDoMessageLoopWork(), and there is a
recursive call to it, then the previous DoDragDrop() can't return
anymore, and will, in turn, prevent CefDoMessageLoopWork() from
returning to the caller.

Prevent recursively re-entering this function to avoid this.

See #24520.

Co-authored-by: Vadim Zeitlin <va...@wxwidgets.org>


Commit: 31966f7d66d88db9b81202ccb7eb29d3479cb8c2
https://github.com/wxWidgets/wxWidgets/commit/31966f7d66d88db9b81202ccb7eb29d3479cb8c2
Author: 徐扬斌 <yb...@coremail.cn>
Date: 2025-12-14 (Sun, 14 Dec 2025)

Changed paths:
M src/osx/cocoa/dnd.mm

Log Message:
-----------
Allow wxDropSource::DoDragDrop() without mouse event in wxOSX

DoDragDrop() may be called not only in response to a mouse event, but
also, when using CEF, from external code.

Synthesize an artificial event in this case instead of failing with an
assert.

See #24520.


Compare: https://github.com/wxWidgets/wxWidgets/compare/35487b06a76d...31966f7d66d8

To unsubscribe from these emails, change your notification settings at https://github.com/wxWidgets/wxWidgets/settings/notifications
Reply all
Reply to author
Forward
0 new messages