问题
Our windowless plugin wants to set different mouse cursors, but it doesn't seem to get WM_SETCURSOR
messages (this doesn't really surprise me for a windowless plugin that is doing composing). The browser seems to be trying to revert the cursor back to the default arrow cursor. Thus we have a hack in our plugin code to call ::SetCursor(...)
after every mouse move. This works but on Chrome you get very significant flicker.
This is all when we haven't captured the mouse. If we've captured it then things are ok.
- We need to keep the plugin windowless.
- Chrome doesn't seem to support
NPAPI:DOMCursors
. - I thought about having a callback into Javascript and setting the cursor there. But a quick check of calling
document.getElementById("my_plugin").style.cursor = "crosshair"
doesn't change the mouse cursor in Chrome, even though this can work in Firefox.
Does this mean that in a Chrome windowless plugin you are always stuck with the choice between the default mouse cursor / significant flicker? Or is there something I'm missing?
Thanks for any input...
来源:https://stackoverflow.com/questions/19860253/is-it-possible-to-change-the-mouse-cursor-reliably-in-a-windowless-plugin-runnin