4 * i3 - an improved dynamic tiling window manager
6 * © 2009 Michael Stapelberg and contributors
8 * See file LICENSE for license information.
18 #include <xcb/xcb_keysyms.h>
20 #include <X11/keysym.h>
24 extern xcb_window_t root;
25 unsigned int xcb_numlock_mask;
28 * Opens the window we use for input/output and maps it
31 xcb_window_t open_input_window(xcb_connection_t *conn, uint32_t width, uint32_t height) {
32 xcb_window_t win = xcb_generate_id(conn);
33 //xcb_cursor_t cursor_id = xcb_generate_id(conn);
36 /* Use the default cursor (left pointer) */
38 i3Font *cursor_font = load_font(conn, "cursor");
39 xcb_create_glyph_cursor(conn, cursor_id, cursor_font->id, cursor_font->id,
40 XCB_CURSOR_LEFT_PTR, XCB_CURSOR_LEFT_PTR + 1,
41 0, 0, 0, 65535, 65535, 65535);
48 mask |= XCB_CW_BACK_PIXEL;
51 mask |= XCB_CW_EVENT_MASK;
52 values[1] = XCB_EVENT_MASK_EXPOSURE |
53 XCB_EVENT_MASK_BUTTON_PRESS;
55 xcb_create_window(conn,
57 win, /* the window id */
58 root, /* parent == root */
59 490, 297, width, height, /* dimensions */
60 0, /* border = 0, we draw our own */
61 XCB_WINDOW_CLASS_INPUT_OUTPUT,
62 XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
68 xcb_change_window_attributes(conn, result, XCB_CW_CURSOR, &cursor_id);
71 /* Map the window (= make it visible) */
72 xcb_map_window(conn, win);