mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
feat: implement CheckViewportState() in InterfaceManager
This commit is contained in:
parent
425e9e26e0
commit
c4b5abd7b5
1 changed files with 14 additions and 0 deletions
|
|
@ -282,11 +282,25 @@ namespace Dalamud.Interface
|
||||||
// Process information needed by ImGuiHelpers each frame.
|
// Process information needed by ImGuiHelpers each frame.
|
||||||
ImGuiHelpers.NewFrame();
|
ImGuiHelpers.NewFrame();
|
||||||
|
|
||||||
|
// Check if we can still enable viewports without any issues.
|
||||||
|
this.CheckViewportState();
|
||||||
|
|
||||||
this.scene.Render();
|
this.scene.Render();
|
||||||
|
|
||||||
return this.presentHook.Original(swapChain, syncInterval, presentFlags);
|
return this.presentHook.Original(swapChain, syncInterval, presentFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckViewportState()
|
||||||
|
{
|
||||||
|
if (this.dalamud.Configuration.IsNeverViewport || this.scene.SwapChain.IsFullScreen || ImGui.GetPlatformIO().Monitors.Size == 1)
|
||||||
|
{
|
||||||
|
ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.ViewportsEnable;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.GetIO().ConfigFlags |= ImGuiConfigFlags.DockingEnable;
|
||||||
|
}
|
||||||
|
|
||||||
public static ImFontPtr DefaultFont { get; private set; }
|
public static ImFontPtr DefaultFont { get; private set; }
|
||||||
public static ImFontPtr IconFont { get; private set; }
|
public static ImFontPtr IconFont { get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue