Skip to content
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

[X11] Grab server while focusing window. #70625

Closed
wants to merge 1 commit into from

Commits on Dec 27, 2022

  1. [X11] Grab server while focusing window.

    When handling the ConfigureNotify event, we get window attributes using
    XGetWindowAttributes and only call XSetInputFocus if the map_state
    attribute is IsViewable.
    
    Occasionally, the map_state attribute was IsViewable but would become
    IsUnmapped by the time the XSetInputFocus request was receieved due
    to a request from another X server connection (e.g. the window manager).
    This would result in a BadMatch error and cause Godot to crash.
    
    By calling XGrabServer before XGetWindowAttributes and XSetInputFocus we
    ensure that the X server will only receive requests from this connection
    and therefore the map_state attribute will not change until XUngrabServer
    is called.
    
    Fixes godotengine#65425
    lihop committed Dec 27, 2022
    Configuration menu
    Copy the full SHA
    8efe515 View commit details
    Browse the repository at this point in the history