GDK W32: More flexible modal operation mode

Instead of using a boolean to indicate a modal operation being in progress,
use a set of flags, and allow these to be set and unset independently.

Specifically, this allows WM_CAPTURECHANGED handler to only act when a drag-move or
drag-resize modal operation is in progress, and ignore DND (which can also cause
WM_CAPTURECHANGED to be posted). This avoids a crash due to assertion failure when
OLE2 DND code tries to end a modal operation that was already ended by the WM_CAPTURECHANGED
handler.

https://bugzilla.gnome.org/show_bug.cgi?id=786121
This commit is contained in:
Руслан Ижбулатов
2017-08-11 07:00:41 +00:00
parent 87673af98c
commit 87103b9a14
5 changed files with 57 additions and 34 deletions

View File

@ -73,7 +73,7 @@ GdkWin32DndState _dnd_source_state = GDK_WIN32_DND_NONE;
gint _gdk_input_ignore_wintab = FALSE;
gint _gdk_max_colors = 0;
gboolean _modal_operation_in_progress = FALSE;
GdkWin32ModalOpKind _modal_operation_in_progress = GDK_WIN32_MODAL_OP_NONE;
HWND _modal_move_resize_window = NULL;
gboolean _ignore_destroy_clipboard = FALSE;