]> git.sur5r.net Git - i3/i3lock/blobdiff - xcb.c
Properly handle Caps Lock (Thanks Damien)
[i3/i3lock] / xcb.c
diff --git a/xcb.c b/xcb.c
index c418bd5959a75b71659d12e527fb2a40957f9a84..a2477633631c09866f68043b3fad1844a34e5f79 100644 (file)
--- a/xcb.c
+++ b/xcb.c
@@ -1,7 +1,7 @@
 /*
  * vim:ts=4:sw=4:expandtab
  *
- * © 2010-2011 Michael Stapelberg
+ * © 2010-2012 Michael Stapelberg
  *
  * xcb.c: contains all functions which use XCB to talk to X11. Mostly wrappers
  *        around the rather complicated/ugly parts of the XCB API.
@@ -20,6 +20,9 @@
 
 #include "cursors.h"
 
+xcb_connection_t *conn;
+xcb_screen_t *screen;
+
 #define curs_invisible_width 8
 #define curs_invisible_height 8
 
@@ -90,6 +93,7 @@ xcb_pixmap_t create_bg_pixmap(xcb_connection_t *conn, xcb_screen_t *scr, u_int32
     xcb_create_gc(conn, gc, bg_pixmap, XCB_GC_FOREGROUND, values);
     xcb_rectangle_t rect = { 0, 0, resolution[0], resolution[1] };
     xcb_poly_fill_rectangle(conn, bg_pixmap, gc, 1, &rect);
+    xcb_free_gc(conn, gc);
 
     return bg_pixmap;
 }
@@ -118,7 +122,7 @@ xcb_window_t open_fullscreen_window(xcb_connection_t *conn, xcb_screen_t *scr, c
                 XCB_EVENT_MASK_STRUCTURE_NOTIFY;
 
     xcb_create_window(conn,
-                      24,
+                      XCB_COPY_FROM_PARENT,
                       win, /* the window id */
                       scr->root, /* parent == root */
                       0, 0,
@@ -168,6 +172,8 @@ uint32_t get_mod_mask(xcb_connection_t *conn, xcb_key_symbols_t *symbols, uint32
             }
         }
 
+    free(modeswitchcodes);
+    free(modmap_r);
     return 0;
 }