Mouse drag for each window

Co-authored-by: lewar73
This commit is contained in:
Çağatay Yiğit 2023-09-01 14:53:30 +03:00
parent ca7d763ec3
commit 3e273ac26b
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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;
}