Scrolling: Made mouse-wheel scrolling lock the underlying window until the mouse is moved again or until a short delay expires (2 seconds). This allow uninterrupted scroll even if child windows are passing under the mouse cursor. (#2604)

This commit is contained in:
omar
2019-07-22 18:48:39 -07:00
parent dcd03f62a7
commit 26f14e056c
3 changed files with 41 additions and 7 deletions

View File

@ -868,6 +868,9 @@ struct ImGuiContext
ImGuiWindow* HoveredWindow; // Will catch mouse inputs
ImGuiWindow* HoveredRootWindow; // Will catch mouse inputs (for focus/move only)
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow* WheelingWindow;
ImVec2 WheelingWindowRefMousePos;
float WheelingWindowTimer;
// Item/widgets state and tracking information
ImGuiID HoveredId; // Hovered widget
@ -1058,6 +1061,8 @@ struct ImGuiContext
HoveredWindow = NULL;
HoveredRootWindow = NULL;
MovingWindow = NULL;
WheelingWindow = NULL;
WheelingWindowTimer = 0.0f;
HoveredId = 0;
HoveredIdAllowOverlap = false;