Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MacOSX: Keep DoDragDrop() from re-entering to enable a proper working…
… CEF. DoDragDrop() may make CEF cease to work. One way to reproduce the problem: Do drag-n-drop repeatly, that is, start drag immediately after one drop, then there're chances we can see large amount of DoDragDrop() in the callstack of the UI-thread. And finally leads to stack overflow. Messages processed by CEF are handled when wxEVT_IDLE is triggered. The basic loop are: -> Step1, cocoa call OSXDefaultModeObserverCallBack(in src/osx/core/evtloop_cf.cpp) -> Step2, wxEVT_IDLE is triggered. -> Step3, wxWebViewChroium::OnIdle() takes the cake. -> Step4, CefDoMessageLoopWork() do the jobs for CEF. If DoDragDrop() is invoked during CefDoMessageLoopWork(), and together there comes a recursive call to it, then the previous DoDragDrop() can't return anymore, and will, in turn, prevent CefDoMessageLoopWork() from returning to the caller. And finally overflow the stack. And now we add the global dnd flag to stay away from this kind of tragic.
- Loading branch information