-
July 29th, 2012, 06:41 AM
#1
Wm_entersizemove / wm_exitsizemove
I'm trying to fix a bug that I've found in the Windows version of libgdk. Consider this code fragment from a switch statement:-
Code:
case WM_ENTERSIZEMOVE:
case WM_ENTERMENULOOP:
_gdk_win32_begin_modal_call ();
break;
case WM_EXITSIZEMOVE:
case WM_EXITMENULOOP:
_gdk_win32_end_modal_call ();
break;
The way the code is currently written, every call to _gdk_win32_begin_modal_call() is expected to be matched by a subsequent call to _gdk_win32_end_modal_call(). WM_ENTERSIZEMOVE seems to get sent whenever a user right-clicks on a top level window's title bar (e.g. to select "Move" from the popup menu that gets displayed).
If I do actually move the window, when I release my mouse button (to finish the move) WM_EXITSIZEMOVE gets sent which neatly calls _gdk_win32_end_modal_call()
BUT.... if I right-click a title bar, then (without moving the window) I simply cancel the move by left-clicking my mouse on the desktop, WM_EXITSIZEMOVE doesn't seem to get get sent. The way the code is written, this causes a crash if I subsequently right-click the title bar again.
Is there some other message I can trap to detect when the user cancels a move before it even begins?
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
July 29th, 2012, 11:53 AM
#2
Re: Wm_entersizemove / wm_exitsizemove
Seems strange that there's a message to indicate when a resize operation begins and another one to indicate when it ended - but no message to indicate that it was abandoned. Anyway, I managed to get around it by intercepting WM_CAPTURECHANGED
"A problem well stated is a problem half solved.” - Charles F. Kettering
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|