Skip to content

BadWindow X error when moving cursor while dropping a file. #79

@tehrencron

Description

@tehrencron

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions