Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emscripten_glfw_make_canvas_resizable does not cleanup properly #6

Closed
ypujante opened this issue Jul 3, 2024 · 0 comments · Fixed by emscripten-core/emscripten#22303

Comments

@ypujante
Copy link
Member

ypujante commented Jul 3, 2024

The following steps reproduce the problem:

  1. Call emscripten_glfw_make_canvas_resizable with a canvasResizeSelector non null and a handleSelector non null
  2. Change the size of the window using the handle and notice how the html element corresponding to canvasResizeSelector now has a width and height style properties
  3. Call emscripten_glfw_make_canvas_resizable with a canvasResizeSelector null (or equivalently call emscripten_glfw_unmake_canvas_resizable)
  4. Notice how the width and height style properties remain instead of being restored to their original values (which if there was none in the first place should be removed)

The problem can be easily reproduced using the example: Resizable Container With Handle

sbc100 pushed a commit to emscripten-core/emscripten that referenced this issue Aug 2, 2024
This contains 2 new versions with the following release notes for the
underlying project:

#### 3.4.0.20240731 - 2024-07-31

- Added `emscripten_glfw_get_clipboard_string` the C version of
`emscripten::glfw3::GetClipboardString` to
  retrieve the clipboard asynchronously
- Added a helper class `emscripten::glfw3::FutureClipboardString` to
greatly simplify the more frequent use-cases
- `GetClipboardString::value()` now returns the internal clipboard in
case of error, instead of throwing exception
- Added `optimizationLevel` option to the emscripten port

#### 3.4.0.20240727 - 2024-07-27

- Introduced C++ API (namespace `emscripten::glfw3`) included with
`GLFW3/emscripten_glfw3.h`:
- provides a more correct API with sensible defaults (ex:
`std::string_view` / `std::optional<std::string_view>`
    vs `char const *` which may or may not be `nullptr`)
  - allow for C++ only API (ex: `std::future`)
  - the C API is still available if you would rather stick to it
- Implemented `emscripten::glfw3::GetClipboardString` which provides a
way of fetching the global
clipboard in a browser environment (`glfwGetClipboardString` is not the
right API due to the asynchronous nature
  of the underlying platform API).
- The cursor position is no longer clamped to the window size, and as a
result, can have negative values or values
  greater than the window size.
Note that GLFW implements a similar behavior on the macOS desktop
platform.
- Implemented `glfwSetWindowPosCallback`
- Added support for GLFW Window Attribute `GLFW_HOVERED`
- Fixed [#6](pongasoft/emscripten-glfw#6):
_`emscripten_glfw_make_canvas_resizable` does not clean up properly_.
- Fixed an issue with opacity: when using opacity, the handle is not
working unless its z-index is higher than the
  canvas z-index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant