ImGui now passes events on to main window

docking
TheCherno 4 years ago
parent 73b030146f
commit d08ca55bfe

@ -111,8 +111,8 @@ static void ImGui_ImplGlfw_SetClipboardText(void* user_data, const char* text)
void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods) void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods)
{ {
if (g_PrevUserCallbackMousebutton != NULL && window == g_Window) if (g_PrevUserCallbackMousebutton != NULL)
g_PrevUserCallbackMousebutton(window, button, action, mods); g_PrevUserCallbackMousebutton(g_Window, button, action, mods);
if (action == GLFW_PRESS && button >= 0 && button < IM_ARRAYSIZE(g_MouseJustPressed)) if (action == GLFW_PRESS && button >= 0 && button < IM_ARRAYSIZE(g_MouseJustPressed))
g_MouseJustPressed[button] = true; g_MouseJustPressed[button] = true;
@ -120,8 +120,8 @@ void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int acti
void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset) void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset)
{ {
if (g_PrevUserCallbackScroll != NULL && window == g_Window) if (g_PrevUserCallbackScroll != NULL)
g_PrevUserCallbackScroll(window, xoffset, yoffset); g_PrevUserCallbackScroll(g_Window, xoffset, yoffset);
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
io.MouseWheelH += (float)xoffset; io.MouseWheelH += (float)xoffset;
@ -130,8 +130,8 @@ void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yo
void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods)
{ {
if (g_PrevUserCallbackKey != NULL && window == g_Window) if (g_PrevUserCallbackKey != NULL)
g_PrevUserCallbackKey(window, key, scancode, action, mods); g_PrevUserCallbackKey(g_Window, key, scancode, action, mods);
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
if (action == GLFW_PRESS) if (action == GLFW_PRESS)

Loading…
Cancel
Save