diff options
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r-- | platform/windows/os_windows.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index b0a50ca4b8..cebafdabce 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -581,11 +581,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { } } else if (mouse_mode!=MOUSE_MODE_CAPTURED) { // for reasons unknown to mankind, wheel comes in screen cordinates - RECT rect; - GetWindowRect(hWnd,&rect); - mb.x-=rect.left; - mb.y-=rect.top; + POINT coords; + coords.x = mb.x; + coords.y = mb.y; + ScreenToClient(hWnd, &coords); + + mb.x = coords.x; + mb.y = coords.y; } if (main_loop) { @@ -1340,7 +1343,7 @@ void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) { void OS_Windows::alert(const String& p_alert,const String& p_title) { if (!is_no_window_mode_enabled()) - MessageBoxW(NULL,p_alert.c_str(),p_title.c_str(),MB_OK|MB_ICONEXCLAMATION); + MessageBoxW(NULL, p_alert.c_str(), p_title.c_str(), MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); else print_line("ALERT: "+p_alert); } @@ -1361,7 +1364,9 @@ void OS_Windows::set_mouse_mode(MouseMode p_mode) { POINT pos = { (int) center.x, (int) center.y }; ClientToScreen(hWnd, &pos); SetCursorPos(pos.x, pos.y); + ShowCursor(false); } else { + ShowCursor(true); ReleaseCapture(); ClipCursor(NULL); } @@ -1473,6 +1478,7 @@ Point2 OS_Windows::get_window_position() const{ } void OS_Windows::set_window_position(const Point2& p_position){ + if (video_mode.fullscreen) return; RECT r; GetWindowRect(hWnd,&r); MoveWindow(hWnd,p_position.x,p_position.y,r.right-r.left,r.bottom-r.top,TRUE); @@ -1683,6 +1689,17 @@ bool OS_Windows::get_borderless_window() { return video_mode.borderless_window; } +void OS_Windows::request_attention() { + + FLASHWINFO info; + info.cbSize = sizeof(FLASHWINFO); + info.hwnd = hWnd; + info.dwFlags = FLASHW_TRAY; + info.dwTimeout = 0; + info.uCount = 2; + FlashWindowEx(&info); +} + void OS_Windows::print_error(const char* p_function, const char* p_file, int p_line, const char* p_code, const char* p_rationale, ErrorType p_type) { HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE); |