From a0d03ef1fca28d374e2c96b4d2d1b5995865a229 Mon Sep 17 00:00:00 2001 From: Noel Borthwick Date: Sun, 18 Apr 1999 09:21:01 +0000 Subject: [PATCH] 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. --- windows/x11drv/event.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/windows/x11drv/event.c b/windows/x11drv/event.c index e73ffca1dea..1577b8b0f19 100644 --- a/windows/x11drv/event.c +++ b/windows/x11drv/event.c @@ -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);