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

osr: windows: custom cursors deleted directly after passing to OnCursorChange #3728

Open
markus-neff-bl opened this issue Jul 1, 2024 · 0 comments
Labels
bug Bug report help wanted Issue resolution will likely require community contributions osr Related to off-screen rendering windows Windows platform

Comments

@markus-neff-bl
Copy link

Bug description
In CEF OSR mode, (custom) cursors are passed to the host application via "CefDisplayHandler::OnCursorChange".
The call comes from "cursor_util::OnCursorChange", where before being passed out, the cursor is put into a ScopedCursorHandle.
The "naked" cursor handle is passed out to the host, so there is no chance for participation in ref-counting or similar.

This leaves the host application with a handle that directly after "CefDisplayHandler::OnCursorChange" becomes invalid.

If the application sets the windows application Cursor e.g. via "SetCursor", the cursor changes but afterwards, the OS seems to also have a "dangling reference" to the cursor. This can be observed with calling "GetCursorInfo", which returns an error in this situation.

Applications like Barco ClickShare which use "GetCursorInfo" to get and transmit the cursor this way cannot capture and therefore not display the cursor shape on the remote display.

For system cursors, the problem does not surface as those standard cursor handles cannot be deleted and stay valid.

To Reproduce

  1. Start cefclient in OSR mode
  2. Browse to a html page that uses custom cursors
  3. In another application, repeatedly call "GetCursorInfo"
  4. See call failing with a windows error code

Expected behavior
Expectation would be that one can either take ownership of the returned cursor handle or participate in shared ownership. The workaround is to clone the cursor in the callback, which is not very nice.

Versions (please complete the following information):

  • OS: Win 11
  • CEF Version: 126.2.9
  • Chromium Version: 126.0.6478.127

Additional context
The problem can be reproduce with the cefclient application.

@markus-neff-bl markus-neff-bl added the bug Bug report label Jul 1, 2024
@magreenblatt magreenblatt added windows Windows platform osr Related to off-screen rendering labels Jul 1, 2024
@magreenblatt magreenblatt changed the title OSR mode on Windows: custom cursors deleted directly after passing them out via "OnCursorChange" osr: windows: custom cursors deleted directly after passing to OnCursorChange Jul 1, 2024
@magreenblatt magreenblatt added the help wanted Issue resolution will likely require community contributions label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report help wanted Issue resolution will likely require community contributions osr Related to off-screen rendering windows Windows platform
Projects
None yet
Development

No branches or pull requests

2 participants