emscripten-core / emscripten-core/emscripten

glfwSetWindowFocusCallback does not seem to work

Open
#26,230 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Calling `glfwSetWindowFocusCallback` succeeds but the callback does not seem to be actually called on focus change. Getting the window focus via `glfwGetWindowAttrib` doesn't work either (it always returns true).

I know my version is out of date but even in the master branch it looks like `GLFW_FOCUSED` and `window.windowFocusFunc` are never referenced. The `onBlur` event handler in libglfw.js also doesn't do anything to propagate this event.

Is there a reason this isn't implemented? It seems that everything is in place -- I can give it a go if I'm not talking crazy here.

**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.59 (0e4c5994eb5b8defd38367a416d0703fd506ad81)
clang version 19.0.0git (https:/github.com/llvm/llvm-project df762a1643bb5b0b3c907611d118c82d4b68a39d)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.