4 * i3 - an improved dynamic tiling window manager
6 * © 2009 Michael Stapelberg and contributors
8 * See file LICENSE for license information.
17 #include <xcb/xcb_keysyms.h>
19 #include <X11/keysym.h>
24 * Opens the window we use for input/output and maps it
27 xcb_window_t open_input_window(xcb_connection_t *conn, uint32_t width, uint32_t height) {
28 xcb_window_t win = xcb_generate_id(conn);
29 //xcb_cursor_t cursor_id = xcb_generate_id(conn);
32 /* Use the default cursor (left pointer) */
34 i3Font *cursor_font = load_font(conn, "cursor");
35 xcb_create_glyph_cursor(conn, cursor_id, cursor_font->id, cursor_font->id,
36 XCB_CURSOR_LEFT_PTR, XCB_CURSOR_LEFT_PTR + 1,
37 0, 0, 0, 65535, 65535, 65535);
44 mask |= XCB_CW_BACK_PIXEL;
47 mask |= XCB_CW_OVERRIDE_REDIRECT;
50 mask |= XCB_CW_EVENT_MASK;
51 values[2] = XCB_EVENT_MASK_EXPOSURE;
53 xcb_create_window(conn,
55 win, /* the window id */
56 root, /* parent == root */
57 50, 50, width, height, /* dimensions */
58 0, /* border = 0, we draw our own */
59 XCB_WINDOW_CLASS_INPUT_OUTPUT,
60 XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
66 xcb_change_window_attributes(conn, result, XCB_CW_CURSOR, &cursor_id);
69 /* Map the window (= make it visible) */
70 xcb_map_window(conn, win);