Is it possible to change the mouse cursor reliably in a Windowless Plugin running inside Chrome

人走茶凉 提交于 2019-12-11 11:25:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!