Assume xcb_cursor_context_new never fails (#3955)

According to libxcb-cursor code, the only condition in which
xcb_cursor_context_new() returns a non-zero result is a memory
allocation failure[1].  Thus, it is safe to assume that
xcursor_supported is always true, and remove dead code.

[1]: https://gitlab.freedesktop.org/xorg/lib/libxcb-cursor/blob/0.1.3/cursor/cursor.c#L131-132
This commit is contained in:
xzfc
2020-02-24 07:48:58 +00:00
committed by GitHub
parent 0ba325c5f3
commit 47be36410c
10 changed files with 17 additions and 116 deletions

View File

@@ -87,7 +87,6 @@ struct assignments_head assignments = TAILQ_HEAD_INITIALIZER(assignments);
struct ws_assignments_head ws_assignments = TAILQ_HEAD_INITIALIZER(ws_assignments);
/* We hope that those are supported and set them to true */
bool xcursor_supported = true;
bool xkb_supported = true;
bool shape_supported = true;
@@ -641,10 +640,7 @@ int main(int argc, char *argv[]) {
/* Set a cursor for the root window (otherwise the root window will show no
cursor until the first client is launched). */
if (xcursor_supported)
xcursor_set_root_cursor(XCURSOR_CURSOR_POINTER);
else
xcb_set_root_cursor(XCURSOR_CURSOR_POINTER);
xcursor_set_root_cursor(XCURSOR_CURSOR_POINTER);
const xcb_query_extension_reply_t *extreply;
xcb_prefetch_extension_data(conn, &xcb_xkb_id);