diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index d199ae278b..7ce0760d50 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -430,34 +430,6 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar ::InvalidateRect(GetHwnd(), NULL, false /* erase bg */); } break; - -#ifndef __WXMICROWIN__ - case WM_SETCURSOR: - // we want to override the busy cursor for modal dialogs: - // typically, wxBeginBusyCursor() is called and then a modal dialog - // is shown, but the modal dialog shouldn't have hourglass cursor - if ( IsModal() && wxIsBusy() ) - { - // set our cursor for all windows (but see below) - wxCursor cursor = m_cursor; - if ( !cursor.IsOk() ) - cursor = wxCURSOR_ARROW; - - ::SetCursor(GetHcursorOf(cursor)); - - // in any case, stop here and don't let wxWindow process this - // message (it would set the busy cursor) - processed = true; - - // but return false to tell the child window (if the event - // comes from one of them and not from ourselves) that it can - // set its own cursor if it has one: thus, standard controls - // (e.g. text ctrl) still have correct cursors in a dialog - // invoked while wxIsBusy() - rc = false; - } - break; -#endif // __WXMICROWIN__ } if ( !processed ) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 21a5a71613..0e3f79e4db 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -34,6 +34,7 @@ #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" + #include "wx/dialog.h" #include "wx/utils.h" #include "wx/app.h" #include "wx/layout.h" @@ -4198,7 +4199,20 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd), // 3. if still no cursor but we're in a TLW, set the global cursor HCURSOR hcursor = 0; + + // Check for "business" is complicated by the fact that modal dialogs shown + // while busy cursor is in effect shouldn't show it as they are active and + // accept input from the user, unlike all the other windows. + bool isBusy = false; if ( wxIsBusy() ) + { + wxDialog* const + dlg = wxDynamicCast(wxGetTopLevelParent(this), wxDialog); + if ( !dlg || !dlg->IsModal() ) + isBusy = true; + } + + if ( isBusy ) { hcursor = wxGetCurrentBusyCursor(); }