We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5427 - X_setInputfocus BadMatch 42
Summary: X_setInputfocus BadMatch 42
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.12
Hardware: x86_64 Linux
: P2 blocker
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.16
Depends on:
Blocks:
 
Reported: 2020-12-30 23:20 UTC by ghen_arcanum
Modified: 2021-01-12 17:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ghen_arcanum 2020-12-30 23:20:08 UTC
Operating System: Void Linux

When starting the program, the new window blinks for a second then crashes with:

Pioneer:
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  42 (X_SetInputFocus)
  Serial number of failed request:  220
  Current serial number in output stream:  221

Grafx-sdl2 version:
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  42 (X_SetInputFocus)
  Serial number of failed request:  214
  Current serial number in output stream:  215

I came across this while compiling grafx2 for void linux. You can do three versions with it: normaly it uses sdl 1.2.x for compiling, which works fine. The X-version without sdl works fine too, just the sdl2 version doesn't work.

likewise every program using sdl2 crashes on my system.

I have quite a niche windowmanager, which is amiwm. But Gimp and Krita works totally fine with it. 

It seems that your competition had a similar problem:
https://github.com/SFML/SFML/issues/991
and there it was even linked to a bug here
https://bugzilla.libsdl.org/show_bug.cgi?id=2997
and it even says it is patched! Which is confusing.

What is going on? :) thx in advance
Comment 1 Ryan C. Gordon 2021-01-12 17:21:11 UTC
Going to guess it's this code in X11_ShowWindow...

    if (!data->videodata->net_wm) {
        /* no WM means no FocusIn event, which confuses us. Force it. */
        X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime);
        X11_XFlush(display);
    }

I'll try to reproduce over here.

--ryan.