From 485eda2c618f67f20aebfab93ccc74986dda151e Mon Sep 17 00:00:00 2001 From: goaaats Date: Tue, 21 Jun 2022 13:15:25 +0200 Subject: [PATCH] fix: grab focus for installer when opening the error modal --- .../Internal/Windows/PluginInstaller/PluginInstallerWindow.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index b98e4e5f1..1845156b4 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -386,6 +386,10 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller if (this.errorModalOnNextFrame) { + // NOTE(goat): ImGui cannot open a modal if no window is focused, at the moment. + // If people click out of the installer into the game while a plugin is installing, we won't be able to show a modal if we don't grab focus. + ImGui.SetWindowFocus(this.WindowName); + ImGui.OpenPopup(modalTitle); this.errorModalOnNextFrame = false; this.errorModalDrawing = true;