Effectively it is currently the later, but see comment "Even without focus, we assume the window becomes front-most." in UpdatePlatformWindows().
+ Moved Window field at top since it is most useful.
ImGuiViewportFlags_IsPlatformWindow=1<<0,// Represent a Platform Window
ImGuiViewportFlags_IsPlatformWindow=1<<0,// Represent a Platform Window
ImGuiViewportFlags_IsPlatformMonitor=1<<1,// Represent a Platform Monitor (unused yet)
ImGuiViewportFlags_IsPlatformMonitor=1<<1,// Represent a Platform Monitor (unused yet)
ImGuiViewportFlags_OwnedByApp=1<<2,// Platform Window: is created/managed by the application (rather than a dear imgui backend)
ImGuiViewportFlags_OwnedByApp=1<<2,// Platform Window: Was created/managed by the user application? (rather than our backend)
ImGuiViewportFlags_NoDecoration=1<<3,// Platform Window: Disable platform decorations: title bar, borders, etc. (generally set all windows, but if ImGuiConfigFlags_ViewportsDecoration is set we only set this on popups/tooltips)
ImGuiViewportFlags_NoDecoration=1<<3,// Platform Window: Disable platform decorations: title bar, borders, etc. (generally set all windows, but if ImGuiConfigFlags_ViewportsDecoration is set we only set this on popups/tooltips)
ImGuiViewportFlags_NoTaskBarIcon=1<<4,// Platform Window: Disable platform task bar icon (generally set on popups/tooltips, or all windows if ImGuiConfigFlags_ViewportsNoTaskBarIcon is set)
ImGuiViewportFlags_NoTaskBarIcon=1<<4,// Platform Window: Disable platform task bar icon (generally set on popups/tooltips, or all windows if ImGuiConfigFlags_ViewportsNoTaskBarIcon is set)
ImGuiViewportFlags_NoFocusOnAppearing=1<<5,// Platform Window: Don't take focus when created.
ImGuiViewportFlags_NoFocusOnAppearing=1<<5,// Platform Window: Don't take focus when created.
ImGuiViewportFlags_NoFocusOnClick=1<<6,// Platform Window: Don't take focus when clicked on.
ImGuiViewportFlags_NoFocusOnClick=1<<6,// Platform Window: Don't take focus when clicked on.
ImGuiViewportFlags_NoInputs=1<<7,// Platform Window: Make mouse pass through so we can drag this window while peaking behind it.
ImGuiViewportFlags_NoInputs=1<<7,// Platform Window: Make mouse pass through so we can drag this window while peaking behind it.
ImGuiViewportFlags_NoRendererClear=1<<8,// Platform Window: Renderer doesn't need to clear the framebuffer ahead (because we will fill it entirely).
ImGuiViewportFlags_NoRendererClear=1<<8,// Platform Window: Renderer doesn't need to clear the framebuffer ahead (because we will fill it entirely).
ImGuiViewportFlags_TopMost=1<<9,// Platform Window: Display on top (for tooltips only).
ImGuiViewportFlags_NoAutoMerge=1<<9,// Platform Window: Avoid merging this window into another host window. This can only be set via ImGuiWindowClass viewport flags override (because we need to now ahead if we are going to create a viewport in the first place!).
ImGuiViewportFlags_Minimized=1<<10,// Platform Window: Window is minimized, can skip render. When minimized we tend to avoid using the viewport pos/size for clipping window or testing if they are contained in the viewport.
ImGuiViewportFlags_TopMost=1<<10,// Platform Window: Display on top (for tooltips only).
ImGuiViewportFlags_NoAutoMerge=1<<11,// Platform Window: Avoid merging this window into another host window. This can only be set via ImGuiWindowClass viewport flags override (because we need to now ahead if we are going to create a viewport in the first place!).
ImGuiViewportFlags_CanHostOtherWindows=1<<11,// Viewport can host multiple imgui windows (secondary viewports are associated to a single window). // FIXME: In practice there's still probably code making the assumption that this is always and only on the MainViewport. Will fix once we add support for "no main viewport".
ImGuiViewportFlags_CanHostOtherWindows=1<<12,// Main viewport: can host multiple imgui windows (secondary viewports are associated to a single window).
// Output status flags (from Platform)
ImGuiViewportFlags_IsMinimized=1<<12,// Platform Window: Window is minimized, can skip render. When minimized we tend to avoid using the viewport pos/size for clipping window or testing if they are contained in the viewport.
};
};
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
// Every instance of ImGuiViewport is in fact a ImGuiViewportP.
// Every instance of ImGuiViewport is in fact a ImGuiViewportP.
structImGuiViewportP:publicImGuiViewport
structImGuiViewportP:publicImGuiViewport
{
{
ImGuiWindow*Window;// Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set)
intIdx;
intIdx;
intLastFrameActive;// Last frame number this viewport was activated by a window
intLastFrameActive;// Last frame number this viewport was activated by a window
intLastFrontMostStampCount;// Last stamp number from when a window hosted by this viewport was made front-most (by comparing this value between two viewport we have an implicit viewport z-order
intLastFocusedStampCount;// Last stamp number from when a window hosted by this viewport was focused (by comparing this value between two viewport we have an implicit viewport z-order we use as fallback)
ImGuiIDLastNameHash;
ImGuiIDLastNameHash;
ImVec2LastPos;
ImVec2LastPos;
floatAlpha;// Window opacity (when dragging dockable windows/viewports we make them transparent)
floatAlpha;// Window opacity (when dragging dockable windows/viewports we make them transparent)
floatLastAlpha;
floatLastAlpha;
shortPlatformMonitor;
shortPlatformMonitor;
ImGuiWindow*Window;// Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set)
intDrawListsLastFrame[2];// Last frame number the background (0) and foreground (1) draw lists were used
intDrawListsLastFrame[2];// Last frame number the background (0) and foreground (1) draw lists were used
ImDrawList*DrawLists[2];// Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays.
ImDrawList*DrawLists[2];// Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays.
ImDrawDataDrawDataP;
ImDrawDataDrawDataP;
@ -1751,7 +1751,7 @@ struct ImGuiViewportP : public ImGuiViewport
ImVec2BuildWorkOffsetMin;// Work Area: Offset being built during current frame. Generally >= 0.0f.
ImVec2BuildWorkOffsetMin;// Work Area: Offset being built during current frame. Generally >= 0.0f.
ImVec2BuildWorkOffsetMax;// Work Area: Offset being built during current frame. Generally <= 0.0f.
ImVec2BuildWorkOffsetMax;// Work Area: Offset being built during current frame. Generally <= 0.0f.
ImGuiViewportP*MouseLastHoveredViewport;// Last known viewport that was hovered by mouse (even if we are not hovering any viewport any more) + honoring the _NoInputs flag.
ImGuiViewportP*MouseLastHoveredViewport;// Last known viewport that was hovered by mouse (even if we are not hovering any viewport any more) + honoring the _NoInputs flag.
ImGuiIDPlatformLastFocusedViewportId;
ImGuiIDPlatformLastFocusedViewportId;
ImGuiPlatformMonitorFallbackMonitor;// Virtual monitor used as fallback if backend doesn't provide monitor information.
ImGuiPlatformMonitorFallbackMonitor;// Virtual monitor used as fallback if backend doesn't provide monitor information.
intViewportFrontMostStampCount;// Every time the front-most window changes, we stamp its viewport with an incrementing counter
intViewportFocusedStampCount;// Every time the front-most window changes, we stamp its viewport with an incrementing counter
// Gamepad/keyboard Navigation
// Gamepad/keyboard Navigation
ImGuiWindow*NavWindow;// Focused window for navigation. Could be called 'FocusedWindow'
ImGuiWindow*NavWindow;// Focused window for navigation. Could be called 'FocusedWindow'