While handling the WM_DELETEWINDOW client message check if a window

has been disabled and if so prevent an SC_CLOSE message from being
sent.
This commit is contained in:
Noel Borthwick 1999-04-18 09:21:01 +00:00 committed by Alexandre Julliard
parent b0ebeeb0d1
commit a0d03ef1fc
1 changed files with 10 additions and 0 deletions

View File

@ -1457,7 +1457,17 @@ static void EVENT_ClientMessage( HWND hWnd, XClientMessageEvent *event )
if (event->message_type != None && event->format == 32) {
if ((event->message_type == wmProtocols) &&
(((Atom) event->data.l[0]) == wmDeleteWindow))
{
/* Ignore the delete window request if the window has been disabled
* and we are in managed mode. This is to disallow applications from
* being closed by the window manager while in a modal state.
*/
BOOL bIsDisabled;
bIsDisabled = GetWindowLongA( hWnd, GWL_STYLE ) & WS_DISABLED;
if ( !Options.managed || !bIsDisabled )
SendMessage16( hWnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
}
else if ( event->message_type == dndProtocol &&
(event->data.l[0] == DndFile || event->data.l[0] == DndFiles) )
EVENT_DropFromOffiX(hWnd, event);