-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Don’t remove JS event handlers on canvas on deleteContext #9803
Conversation
We are done with the context, but might want to continue to use the canvas.
Thank you for submitting a pull request! If this is your first PR, make sure to add yourself to AUTHORS. |
See for QTBUG-74850 for context - this kept us scratching our heads for a while :) |
Thanks @msorvig! That does look like a bug, good find :) Looks like this broke a test on CI, Please also improve the test to check for the bug you are fixing here. I think we can replace the final Let me know if you have any questions about our test suite! |
Yep, I suspected there was more to this. Thanks for the update! I'll see if I can get the tests running. |
Was able to run the test (test_html5_webgl_destroy_context) now. However, I'm not sure if works as intended:
Does this make sense to you? Let me know :) |
It looks like the comment // When we force a context loss, we should get an event, i.e. context_lost_desired() should get called. is something old/lost in refactor. Let's remove that line altogether.
Let's add a new function // Removes all event handlers of specific types on the given DOM element. Call with e.g. _JSEvents_removeSpecificHandlersOnTarget(canvas, ['webglcontextlost', 'webglcontextrestored'])
JSEvents_removeSpecificHandlersOnTarget__deps: ['$JSEvents'],
JSEvents_removeSpecificHandlersOnTarget: function(target, eventTypesList) {
for(var i = 0; i < JSEvents.eventHandlers.length; ++i) {
if (JSEvents.eventHandlers[i].target == target &&
eventTypesList.indexOf(JSEvents.eventHandlers[i].eventTypeString) != -1) {
JSEvents._removeHandler(i--);
}
}
}, that enables removing events of specific types. Note that this function should not live inside the In library_html5.js |
The deletion of the Re-opening and re-targeting to master. |
Any news on this? |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
We are done with the context, but might want to continue to use the canvas.