]> git.sur5r.net Git - i3/i3lock/blobdiff - xcb.c
Merge pull request #213 from trickeydan/patch-1
[i3/i3lock] / xcb.c
diff --git a/xcb.c b/xcb.c
index 27a8daedb64a60771bc54319082234c684456f33..4f065542928fc1435d4ee171ebe6c6f22d2b7b78 100644 (file)
--- a/xcb.c
+++ b/xcb.c
@@ -149,6 +149,15 @@ xcb_window_t open_fullscreen_window(xcb_connection_t *conn, xcb_screen_t *scr, c
                         strlen(name),
                         name);
 
+    xcb_change_property(conn,
+                        XCB_PROP_MODE_REPLACE,
+                        win,
+                        XCB_ATOM_WM_CLASS,
+                        XCB_ATOM_STRING,
+                        8,
+                        2 * (strlen("i3lock") + 1),
+                        "i3lock\0i3lock\0");
+
     /* Map the window (= make it visible) */
     xcb_map_window(conn, win);
 
@@ -203,6 +212,9 @@ bool grab_pointer_and_keyboard(xcb_connection_t *conn, xcb_screen_t *screen, xcb
             break;
         }
 
+        /* In case the grab failed, we still need to free the reply */
+        free(preply);
+
         /* Make this quite a bit slower */
         usleep(50);
 
@@ -237,6 +249,9 @@ bool grab_pointer_and_keyboard(xcb_connection_t *conn, xcb_screen_t *screen, xcb
             break;
         }
 
+        /* In case the grab failed, we still need to free the reply */
+        free(kreply);
+
         /* Make this quite a bit slower */
         usleep(50);