mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Focus loss getting triggered when a popup was selected
This commit is contained in:
@@ -376,8 +376,9 @@ namespace hex {
|
||||
}
|
||||
|
||||
void Window::frameBegin() {
|
||||
auto &io = ImGui::GetIO();
|
||||
ImHexApi::Fonts::getDefaultFont().push();
|
||||
ImGui::GetIO().FontDefault = ImHexApi::Fonts::getDefaultFont();
|
||||
io.FontDefault = ImHexApi::Fonts::getDefaultFont();
|
||||
|
||||
// Start new ImGui Frame
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
@@ -396,6 +397,12 @@ namespace hex {
|
||||
|
||||
EventFrameBegin::post();
|
||||
|
||||
static bool lastFocusLost = io.AppFocusLost;
|
||||
if (io.AppFocusLost != lastFocusLost) {
|
||||
EventWindowFocused::post(!io.AppFocusLost);
|
||||
}
|
||||
lastFocusLost = io.AppFocusLost;
|
||||
|
||||
// Handle all undocked floating windows
|
||||
ImGuiViewport *viewport = ImGui::GetMainViewport();
|
||||
ImGui::SetNextWindowPos(viewport->WorkPos);
|
||||
@@ -1127,11 +1134,7 @@ namespace hex {
|
||||
glfwSetCursorPosCallback(m_window, unlockFrameRate);
|
||||
glfwSetMouseButtonCallback(m_window, unlockFrameRate);
|
||||
glfwSetScrollCallback(m_window, unlockFrameRate);
|
||||
|
||||
glfwSetWindowFocusCallback(m_window, [](GLFWwindow *window, int focused) {
|
||||
unlockFrameRate(window);
|
||||
EventWindowFocused::post(focused == GLFW_TRUE);
|
||||
});
|
||||
glfwSetWindowFocusCallback(m_window, unlockFrameRate);
|
||||
|
||||
glfwSetWindowMaximizeCallback(m_window, [](GLFWwindow *window, int) {
|
||||
glfwShowWindow(window);
|
||||
|
||||
Reference in New Issue
Block a user