Crash when using OLE2 DnD
@ruslanizhb
Submitted by LRN Assigned to gtk-win32 maintainers
Link to original bug (#786121)
Description
How to reproduce:
- Run gtk3-demo
- Select IconView->Drag&Drop demo
- Drag and drop iconview elements
- Observe that everything works correctly
- Run * GDK_WIN32_USE_EXPERIMENTAL_OLE2_DND=1 gtk3-demo
- Select IconView->Drag&Drop demo
- Try to drag iconview elements
Expected result:
- Doesn't crash
Actual result:
- Crashes with a message: Gdk:ERROR:gdkevents-win32.c:1760:_gdk_win32_end_modal_call: assertion failed: (_modal_operation_in_progress)
What happens: My code for unrelated issue added handling for WM_CAPTURECHANGED. Turns out, this message is also sent during OLE2 DnD loop. My code cancels the modal operation in response to this message...and then the OLE2 DnD code tries to cancel it again, failing an assertion
Proposed fix: The first thing that comes to my head is to differentiate between different modal operations (say, by changing the _modal_operation_in_progress variable from gboolean to an enum) and don't end DnD op on WM_CAPTURECHANGED.
Version: 3.22.x