When configuring with --with-xwidgets --enable-check-lisp-object-type the Emacs build would fail due to a type confusion in src/xwidget.c, which I attempted to fix by installing the attached patch. However, as noted in the patch, this code appears to have a garbage-collection bug, as it converts a Lisp_Object to a C pointer and stores that pointer (for what appears to be an indefinite period of time) into a C object that the garbage collector does not know about. If garbage-collection reclaims the object before the callback is used, disaster can occur. As I don't know the lifetime of the C object I'm reluctant to try to fix this myself, so I'm filing this bug report in the hope that an xwidget expert can fix it.