]> git.sur5r.net Git - i3/i3/commitdiff
Use unchecked versions for more speed
authorMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 5 Mar 2009 02:33:15 +0000 (03:33 +0100)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 5 Mar 2009 02:33:15 +0000 (03:33 +0100)
src/handlers.c
src/layout.c
src/xcb.c

index 98a05379b64f12f9c5491c06561b96449693b2b7..36f4378becdbab4e55328e27c6570ec3ba37791b 100644 (file)
@@ -501,7 +501,6 @@ int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
  *
  */
 int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *event) {
-        printf("got expose_event\n");
         /* event->count is the number of minimum remaining expose events for this window, so we
            skip all events but the last one */
         if (event->count != 0)
index 0bf16f388dbabce83669bf9e2847c782c33c8f0d..6a441e8c32542d05643bf0937d6c36981f31efd5 100644 (file)
@@ -154,9 +154,7 @@ void decorate_window(xcb_connection_t *conn, Client *client, xcb_drawable_t draw
         /* TODO: utf8? */
         char *label;
         asprintf(&label, "%.*s", client->name_len, client->name);
-        xcb_void_cookie_t text_cookie = xcb_image_text_8_checked(conn, strlen(label), drawable,
-                                        gc, 3 /* X */, offset + font->height /* Y = baseline of font */, label);
-        check_error(conn, text_cookie, "Could not draw client's title");
+        xcb_image_text_8(conn, strlen(label), drawable, gc, 3 /* X */, offset + font->height /* Y = baseline of font */, label);
         free(label);
 }
 
@@ -391,10 +389,8 @@ static void render_internal_bar(xcb_connection_t *conn, Workspace *r_ws, int wid
                         snprintf(label, sizeof(label), "%d", c+1);
                         xcb_change_gc_single(conn, screen->bargc, XCB_GC_FOREGROUND, text_color[set]);
                         xcb_change_gc_single(conn, screen->bargc, XCB_GC_BACKGROUND, background_color[set]);
-                        xcb_void_cookie_t text_cookie = xcb_image_text_8_checked(conn, strlen(label), screen->bar,
-                                                        screen->bargc, drawn * height + 5 /* X */,
+                        xcb_image_text_8(conn, strlen(label), screen->bar, screen->bargc, drawn * height + 5 /* X */,
                                                         font->height + 1 /* Y = baseline of font */, label);
-                        check_error(conn, text_cookie, "Could not draw workspace title");
                         drawn++;
                 }
         }
index 203ebc0bc52719b348b871b1779bd739ae6350c6..5b4260987677a5b2ea197e86964f99a847873da5 100644 (file)
--- a/src/xcb.c
+++ b/src/xcb.c
@@ -120,7 +120,6 @@ xcb_window_t create_window(xcb_connection_t *conn, Rect dims, uint16_t window_cl
         xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
         xcb_window_t result = xcb_generate_id(conn);
         xcb_cursor_t cursor_id = xcb_generate_id(conn);
-        xcb_void_cookie_t cookie;
 
         /* If the window class is XCB_WINDOW_CLASS_INPUT_ONLY, depth has to be 0 */
         uint16_t depth = (window_class == XCB_WINDOW_CLASS_INPUT_ONLY ? 0 : XCB_COPY_FROM_PARENT);
@@ -133,22 +132,19 @@ xcb_window_t create_window(xcb_connection_t *conn, Rect dims, uint16_t window_cl
                                 0, 0, 0, 65535, 65535, 65535);
         }
 
-        cookie = xcb_create_window_checked(conn,
-                                           depth,
-                                           result, /* the window id */
-                                           root, /* parent == root */
-                                           dims.x, dims.y, dims.width, dims.height, /* dimensions */
-                                           0, /* border = 0, we draw our own */
-                                           window_class,
-                                           XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
-                                           mask,
-                                           values);
-        check_error(conn, cookie, "Could not create window");
-
-        if (cursor > -1) {
-                cookie = xcb_change_window_attributes_checked(conn, result, XCB_CW_CURSOR, &cursor_id);
-                check_error(conn, cookie, "Could not change window attributes");
-        }
+        xcb_create_window(conn,
+                          depth,
+                          result, /* the window id */
+                          root, /* parent == root */
+                          dims.x, dims.y, dims.width, dims.height, /* dimensions */
+                          0, /* border = 0, we draw our own */
+                          window_class,
+                          XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
+                          mask,
+                          values);
+
+        if (cursor > -1)
+                xcb_change_window_attributes(conn, result, XCB_CW_CURSOR, &cursor_id);
 
         /* Map the window (= make it visible) */
         xcb_map_window(conn, result);