backend/x11: create per-window present event contexts

The Present protocol states:

> An event context is associated with a specific window; using an existing
> event context with a different window generates a Match error.

Instead of a global event context, use a per-window event context to fix
this error:

    [backend/x11/backend.c:608] X11 error: op Present (SelectInput), code Match (no extension), sequence 63, value 4194307

Closes: https://github.com/swaywm/wlroots/issues/2577
This commit is contained in:
Simon Ser 2020-12-28 12:27:27 +01:00
parent 23b6f3e3f5
commit caeed70f28
3 changed files with 5 additions and 4 deletions

View file

@ -564,8 +564,6 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
}
#endif
x11->present_event_id = xcb_generate_id(x11->xcb);
wlr_input_device_init(&x11->keyboard_dev, WLR_INPUT_DEVICE_KEYBOARD,
&input_device_impl, "X11 keyboard", 0, 0);
wlr_keyboard_init(&x11->keyboard, &keyboard_impl);