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

@ -1041,7 +1041,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS;
/* Don't produce any button or motion events while a window is being
* moved or resized, see bug #151090.
*/
if (_modal_operation_in_progress)
if (_modal_operation_in_progress & GDK_WIN32_MODAL_OP_SIZEMOVE_MASK)
{
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... ignored when moving/sizing\n"));
return FALSE;