Stop Mouse Events from queueing while NSMenu is shown

荒凉一梦 提交于 2021-01-28 02:11:24

问题


I have several NSViews that trigger re-draws during the mouseEntered and mouseExited methods.

When showing an NSMenu in the same window, updating of those NSViews is suspended (they don't get the mouseEntered and Exited events).

My problem is that once the NSMenu is closed (after moving the mouse all over the window outside of the NSMenu), every mouseEntered and Exited event that would have been triggered immediately trigger in a fast sequence. So basically they were queueing up and then unload (and redraw!) virtually at once.

How can I either stop those queued events from propagating once the NSMenu closes, or stop them from queueing all together?

Thanks

来源:https://stackoverflow.com/questions/35956364/stop-mouse-events-from-queueing-while-nsmenu-is-shown

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