When dropping a file from Nautilus on Ubuntu 24.04, my program crashes when I'm moving my cursor while releasing the left mouse button. I traced the error to the XSendEvent() in TkDND_HandleXdndPosition() in unix/TkDND_XDND.c. The <Drop> event is already processed, but it seems that a position event is still triggered or handled after it, resulting in the following error:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 25 (X_SendEvent)
Resource id in failed request: 0x4201b34
Serial number of failed request: 22555
Current serial number in output stream: 22556
Temporarily setting the X Error Handler with XSetErrorHandler with a function that ignores the BadWindow error code, fixes the issue.
When dropping a file from Nautilus on Ubuntu 24.04, my program crashes when I'm moving my cursor while releasing the left mouse button. I traced the error to the
XSendEvent()inTkDND_HandleXdndPosition()inunix/TkDND_XDND.c. The<Drop>event is already processed, but it seems that a position event is still triggered or handled after it, resulting in the following error:Temporarily setting the X Error Handler with
XSetErrorHandlerwith a function that ignores theBadWindowerror code, fixes the issue.