summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/display_server_windows.cpp45
-rw-r--r--platform/windows/gl_manager_windows.h1
-rw-r--r--platform/windows/os_windows.cpp6
3 files changed, 12 insertions, 40 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index ebd0733c55..cc230575c8 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -991,15 +991,6 @@ void DisplayServerWindows::window_set_current_screen(int p_screen, WindowID p_wi
wpos.y = CLAMP(wpos.y, srect.position.y, srect.position.y + srect.size.height - wsize.height / 3);
window_set_position(wpos, p_window);
}
-
- // Don't let the mouse leave the window when resizing to a smaller resolution.
- if (mouse_mode == MOUSE_MODE_CONFINED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) {
- RECT crect;
- GetClientRect(wd.hWnd, &crect);
- ClientToScreen(wd.hWnd, (POINT *)&crect.left);
- ClientToScreen(wd.hWnd, (POINT *)&crect.right);
- ClipCursor(&crect);
- }
}
Point2i DisplayServerWindows::window_get_position(WindowID p_window) const {
@@ -1077,15 +1068,6 @@ void DisplayServerWindows::window_set_position(const Point2i &p_position, Window
AdjustWindowRectEx(&rc, style, false, exStyle);
MoveWindow(wd.hWnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- // Don't let the mouse leave the window when moved.
- if (mouse_mode == MOUSE_MODE_CONFINED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) {
- RECT rect;
- GetClientRect(wd.hWnd, &rect);
- ClientToScreen(wd.hWnd, (POINT *)&rect.left);
- ClientToScreen(wd.hWnd, (POINT *)&rect.right);
- ClipCursor(&rect);
- }
-
wd.last_pos = p_position;
_update_real_mouse_position(p_window);
}
@@ -1227,15 +1209,6 @@ void DisplayServerWindows::window_set_size(const Size2i p_size, WindowID p_windo
}
MoveWindow(wd.hWnd, rect.left, rect.top, w, h, TRUE);
-
- // Don't let the mouse leave the window when resizing to a smaller resolution.
- if (mouse_mode == MOUSE_MODE_CONFINED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) {
- RECT crect;
- GetClientRect(wd.hWnd, &crect);
- ClientToScreen(wd.hWnd, (POINT *)&crect.left);
- ClientToScreen(wd.hWnd, (POINT *)&crect.right);
- ClipCursor(&crect);
- }
}
Size2i DisplayServerWindows::window_get_size(WindowID p_window) const {
@@ -1423,15 +1396,6 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window)
SystemParametersInfoA(SPI_SETMOUSETRAILS, 0, 0, 0);
}
}
-
- // Don't let the mouse leave the window when resizing to a smaller resolution.
- if (mouse_mode == MOUSE_MODE_CONFINED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) {
- RECT crect;
- GetClientRect(wd.hWnd, &crect);
- ClientToScreen(wd.hWnd, (POINT *)&crect.left);
- ClientToScreen(wd.hWnd, (POINT *)&crect.right);
- ClipCursor(&crect);
- }
}
DisplayServer::WindowMode DisplayServerWindows::window_get_mode(WindowID p_window) const {
@@ -3381,6 +3345,15 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
Callable::CallError ce;
window.rect_changed_callback.callp(args, 1, ret, ce);
}
+
+ // Update cursor clip region after window rect has changed.
+ if (mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) {
+ RECT crect;
+ GetClientRect(window.hWnd, &crect);
+ ClientToScreen(window.hWnd, (POINT *)&crect.left);
+ ClientToScreen(window.hWnd, (POINT *)&crect.right);
+ ClipCursor(&crect);
+ }
}
// Return here to prevent WM_MOVE and WM_SIZE from being sent
diff --git a/platform/windows/gl_manager_windows.h b/platform/windows/gl_manager_windows.h
index b97d0f667c..361c559a5a 100644
--- a/platform/windows/gl_manager_windows.h
+++ b/platform/windows/gl_manager_windows.h
@@ -74,7 +74,6 @@ private:
GLWindow *_current_window = nullptr;
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = nullptr;
- PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = nullptr;
// funcs
void _internal_set_current_window(GLWindow *p_win);
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 08299d9b98..d384049fb5 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -830,7 +830,7 @@ class FallbackTextAnalysisSource : public IDWriteTextAnalysisSource {
IDWriteNumberSubstitution *n_sub = nullptr;
public:
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID **ppvInterface) {
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID **ppvInterface) override {
if (IID_IUnknown == riid) {
AddRef();
*ppvInterface = (IUnknown *)this;
@@ -844,11 +844,11 @@ public:
return S_OK;
}
- ULONG STDMETHODCALLTYPE AddRef() {
+ ULONG STDMETHODCALLTYPE AddRef() override {
return InterlockedIncrement(&_cRef);
}
- ULONG STDMETHODCALLTYPE Release() {
+ ULONG STDMETHODCALLTYPE Release() override {
ULONG ulRef = InterlockedDecrement(&_cRef);
if (0 == ulRef) {
delete this;