mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-06 11:28:31 +00:00
This commit is contained in:
@@ -5058,7 +5058,7 @@ static bool IsWindowActiveAndVisible(ImGuiWindow* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
|
// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
|
||||||
void ImGui::UpdateHoveredWindowAndCaptureFlags()
|
void ImGui::UpdateHoveredWindowAndCaptureFlags(const ImVec2& mouse_pos)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
ImGuiIO& io = g.IO;
|
ImGuiIO& io = g.IO;
|
||||||
@@ -5072,7 +5072,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
|
|||||||
// - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point of the frame.
|
// - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point of the frame.
|
||||||
// - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms.
|
// - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms.
|
||||||
bool clear_hovered_windows = false;
|
bool clear_hovered_windows = false;
|
||||||
FindHoveredWindowEx(g.IO.MousePos, false, &g.HoveredWindow, &g.HoveredWindowUnderMovingWindow);
|
FindHoveredWindowEx(mouse_pos, false, &g.HoveredWindow, &g.HoveredWindowUnderMovingWindow);
|
||||||
g.HoveredWindowBeforeClear = g.HoveredWindow;
|
g.HoveredWindowBeforeClear = g.HoveredWindow;
|
||||||
|
|
||||||
// Modal windows prevents mouse from hovering behind them.
|
// Modal windows prevents mouse from hovering behind them.
|
||||||
@@ -5343,7 +5343,7 @@ void ImGui::NewFrame()
|
|||||||
// Find hovered window
|
// Find hovered window
|
||||||
// (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame)
|
// (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame)
|
||||||
// (currently needs to be done after the WasActive=Active loop and FindHoveredWindowEx uses ->Active)
|
// (currently needs to be done after the WasActive=Active loop and FindHoveredWindowEx uses ->Active)
|
||||||
UpdateHoveredWindowAndCaptureFlags();
|
UpdateHoveredWindowAndCaptureFlags(g.IO.MousePos);
|
||||||
|
|
||||||
// Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering)
|
// Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering)
|
||||||
UpdateMouseMovingWindowNewFrame();
|
UpdateMouseMovingWindowNewFrame();
|
||||||
|
@@ -3049,7 +3049,7 @@ namespace ImGui
|
|||||||
|
|
||||||
// NewFrame
|
// NewFrame
|
||||||
IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);
|
IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);
|
||||||
IMGUI_API void UpdateHoveredWindowAndCaptureFlags();
|
IMGUI_API void UpdateHoveredWindowAndCaptureFlags(const ImVec2& mouse_pos);
|
||||||
IMGUI_API void FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window);
|
IMGUI_API void FindHoveredWindowEx(const ImVec2& pos, bool find_first_and_in_any_viewport, ImGuiWindow** out_hovered_window, ImGuiWindow** out_hovered_window_under_moving_window);
|
||||||
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);
|
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);
|
||||||
IMGUI_API void UpdateMouseMovingWindowNewFrame();
|
IMGUI_API void UpdateMouseMovingWindowNewFrame();
|
||||||
|
Reference in New Issue
Block a user