mirror of https://github.com/WerWolv/ImHex
fix: Disable focus handling on the web version since the GLFW_FOCUSED attribute doesn't work
This commit is contained in:
parent
01f24d2f2f
commit
cf5b9da45e
|
|
@ -380,25 +380,27 @@ namespace hex {
|
|||
ImHexApi::Fonts::getDefaultFont().push();
|
||||
io.FontDefault = ImHexApi::Fonts::getDefaultFont();
|
||||
|
||||
{
|
||||
static bool lastAnyWindowFocused = false;
|
||||
bool anyWindowFocused = glfwGetWindowAttrib(m_window, GLFW_FOCUSED);
|
||||
#if !defined(OS_WEB)
|
||||
{
|
||||
static bool lastAnyWindowFocused = false;
|
||||
bool anyWindowFocused = glfwGetWindowAttrib(m_window, GLFW_FOCUSED);
|
||||
|
||||
if (!anyWindowFocused) {
|
||||
const auto platformIo = ImGui::GetPlatformIO();
|
||||
for (auto *viewport : platformIo.Viewports) {
|
||||
if (platformIo.Platform_GetWindowFocus(viewport)) {
|
||||
anyWindowFocused = true;
|
||||
break;
|
||||
if (!anyWindowFocused) {
|
||||
const auto platformIo = ImGui::GetPlatformIO();
|
||||
for (auto *viewport : platformIo.Viewports) {
|
||||
if (platformIo.Platform_GetWindowFocus(viewport)) {
|
||||
anyWindowFocused = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lastAnyWindowFocused != anyWindowFocused)
|
||||
EventWindowFocused::post(anyWindowFocused);
|
||||
|
||||
lastAnyWindowFocused = anyWindowFocused;
|
||||
}
|
||||
|
||||
if (lastAnyWindowFocused != anyWindowFocused)
|
||||
EventWindowFocused::post(anyWindowFocused);
|
||||
|
||||
lastAnyWindowFocused = anyWindowFocused;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Start new ImGui Frame
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
|
|
|
|||
Loading…
Reference in New Issue