]> git.sur5r.net Git - i3/i3lock/commitdiff
little cleanups thanks to Ran Benita’s review
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 18 Jan 2014 18:20:58 +0000 (19:20 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 21 Jun 2014 14:32:18 +0000 (16:32 +0200)
Makefile
i3lock.c

index 9443e977ea07ad817758a34fc6a67dfcf5268fb3..26dd72372c22c8743a6f8faec338df1aa5a9d1ae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,8 +11,8 @@ CFLAGS += -std=c99
 CFLAGS += -pipe
 CFLAGS += -Wall
 CPPFLAGS += -D_GNU_SOURCE
-CFLAGS += $(shell pkg-config --cflags cairo xcb-dpms xcb-xinerama xcb-atom xkbcommon xkbcommon-x11 xkbfile)
-LIBS += $(shell pkg-config --libs cairo xcb-dpms xcb-xinerama xcb-atom xcb-image xkbcommon xkbcommon-x11 xkbfile)
+CFLAGS += $(shell pkg-config --cflags cairo xcb-dpms xcb-xinerama xcb-atom xkbcommon xkbcommon-x11)
+LIBS += $(shell pkg-config --libs cairo xcb-dpms xcb-xinerama xcb-atom xcb-image xkbcommon xkbcommon-x11)
 LIBS += -lpam
 LIBS += -lev
 LIBS += -lm
index f81ea18e7ed00de9e27d84c7247da1bac1b45426..4c8668dc4f613653f28599c1fe7bbf5c5505392e 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -110,8 +110,7 @@ static bool load_keymap(void) {
         }
     }
 
-    if (xkb_keymap != NULL)
-        xkb_keymap_unref(xkb_keymap);
+    xkb_keymap_unref(xkb_keymap);
 
     int32_t device_id = xkb_x11_get_core_keyboard_device_id(conn);
     DEBUG("device = %d\n", device_id);
@@ -127,15 +126,7 @@ static bool load_keymap(void) {
         return false;
     }
 
-    /* Get the initial modifier state to be in sync with the X server.
-     * See https://github.com/xkbcommon/libxkbcommon/issues/1 for why we ignore
-     * the base and latched fields. */
-    //xkb_state_update_mask(new_state,
-    //    0, 0, new_state->components.locked_mods,
-    //    0, 0, new_state->components.locked_group);
-
-    if (xkb_state != NULL)
-        xkb_state_unref(xkb_state);
+    xkb_state_unref(xkb_state);
     xkb_state = new_state;
 
     return true;