diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 6b667d01..46bb8133 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -6201,7 +6201,7 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname); GLFWAPI int glfwVulkanSupported(void); #ifdef ZD_GLFW_FORK -typedef int(*glfwMouseDragCheckFn)(); +typedef int(*glfwMouseDragCheckFn)(GLFWwindow* window); GLFWAPI void SetMouseDragCheckFn(glfwMouseDragCheckFn function); GLFWAPI void glfwGetBorder(int* border); #endif diff --git a/src/win32_window.c b/src/win32_window.c index da55c04b..ab8f2cba 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -82,7 +82,7 @@ void adjust_maximized_client_rect(HWND window, NCCALCSIZE_PARAMS* params) { params->rgrc[0] = monitor_info.rcWork; } -LRESULT hit_test(HWND handle, POINT cursor) { +LRESULT hit_test(_GLFWwindow* wnd, HWND handle, POINT cursor) { // identify borders and corners to allow resizing the window. // Note: On Windows 10, windows behave differently and // allow resizing outside the visible window frame. @@ -96,7 +96,7 @@ LRESULT hit_test(HWND handle, POINT cursor) { return HTNOWHERE; } - const int64_t drag = checkDragFunction ? (checkDragFunction() ? HTCAPTION : HTCLIENT) : HTCLIENT; + const int64_t drag = checkDragFunction ? (checkDragFunction((GLFWwindow*) wnd) ? HTCAPTION : HTCLIENT) : HTCLIENT; enum region_mask { client = 0b0000, @@ -665,7 +665,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l POINT cursor; cursor.x = GET_X_LPARAM(lParam); cursor.y = GET_Y_LPARAM(lParam); - return hit_test(hWnd, cursor); + return hit_test(window, hWnd, cursor); } break; }