From 8eda5392b9e445f20b0f615c3aaba88b4fa175e8 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 17 Nov 2011 09:17:21 +1100 Subject: ::GetCursorPos failure with screen saver handled. Bug #3438780. From Thomas Linder Puls. --- win32/ScintillaWin.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 39ac139af..73e8736fd 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -886,16 +886,17 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam } else { // Display regular (drag) cursor over selection POINT pt; - ::GetCursorPos(&pt); - ::ScreenToClient(MainHWND(), &pt); - if (PointInSelMargin(Point(pt.x, pt.y))) { - DisplayCursor(GetMarginCursor(Point(pt.x, pt.y))); - } else if (PointInSelection(Point(pt.x, pt.y)) && !SelectionEmpty()) { - DisplayCursor(Window::cursorArrow); - } else if (PointIsHotspot(Point(pt.x, pt.y))) { - DisplayCursor(Window::cursorHand); - } else { - DisplayCursor(Window::cursorText); + if (0 != ::GetCursorPos(&pt)) { + ::ScreenToClient(MainHWND(), &pt); + if (PointInSelMargin(Point(pt.x, pt.y))) { + DisplayCursor(GetMarginCursor(Point(pt.x, pt.y))); + } else if (PointInSelection(Point(pt.x, pt.y)) && !SelectionEmpty()) { + DisplayCursor(Window::cursorArrow); + } else if (PointIsHotspot(Point(pt.x, pt.y))) { + DisplayCursor(Window::cursorHand); + } else { + DisplayCursor(Window::cursorText); + } } } return TRUE; -- cgit v1.2.3