Skip to content

Commit

Permalink
use macos behavior automatically (4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Aug 23, 2024
1 parent 3b44581 commit 33709ba
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions backends/imgui_impl_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,17 @@ void ImGui_ImplGlfw_InstallEmscriptenCallbacks(GLFWwindow*, const char* canvas_s
// See https:/pongasoft/emscripten-glfw/blob/master/docs/Usage.md#how-to-make-the-canvas-resizable-by-the-user for an explanation
void ImGui_ImplGlfw_InstallEmscriptenCallbacks(GLFWwindow* window, const char* canvas_selector)
{
GLFWwindow* w = (GLFWwindow*)(EM_ASM_INT({ return Module.glfwGetWindow(UTF8ToString($0)); }, canvas_selector));
IM_ASSERT(window == w); // Sanity check
IM_UNUSED(w);
emscripten_glfw_make_canvas_resizable(window, "window", nullptr);
GLFWwindow* w = (GLFWwindow*)(EM_ASM_INT({ return Module.glfwGetWindow(UTF8ToString($0)); }, canvas_selector));
IM_ASSERT(window == w); // Sanity check
IM_UNUSED(w);
emscripten_glfw_make_canvas_resizable(window, "window", nullptr);
#if EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3 >= 3'4'0'20240817
if(emscripten::glfw3::IsRuntimePlatformApple())
{
ImGui::GetIO().ConfigMacOSXBehaviors = true;
emscripten::glfw3::SetSuperPlusKeyTimeouts(10, 10);
}
#endif
}
#endif // #ifdef EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3

Expand Down

0 comments on commit 33709ba

Please sign in to comment.