mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2024-12-02 14:05:43 -05:00
clang-format -i **/*.[ch]
From here on, we’ll use clang-format to automatically format the source. This has worked well in i3, so we are introducing it for i3lock.
This commit is contained in:
parent
783509b872
commit
68b78a7f57
7 changed files with 192 additions and 197 deletions
12
i3lock.c
12
i3lock.c
|
@ -540,8 +540,7 @@ void handle_screen_resize(void) {
|
|||
*
|
||||
*/
|
||||
static int conv_callback(int num_msg, const struct pam_message **msg,
|
||||
struct pam_response **resp, void *appdata_ptr)
|
||||
{
|
||||
struct pam_response **resp, void *appdata_ptr) {
|
||||
if (num_msg == 0)
|
||||
return 1;
|
||||
|
||||
|
@ -672,8 +671,7 @@ static void raise_loop(xcb_window_t window) {
|
|||
xcb_change_window_attributes(conn, window, XCB_CW_EVENT_MASK,
|
||||
(uint32_t[]){
|
||||
XCB_EVENT_MASK_VISIBILITY_CHANGE |
|
||||
XCB_EVENT_MASK_STRUCTURE_NOTIFY
|
||||
});
|
||||
XCB_EVENT_MASK_STRUCTURE_NOTIFY});
|
||||
xcb_flush(conn);
|
||||
|
||||
DEBUG("Watching window 0x%08x\n", window);
|
||||
|
@ -734,8 +732,7 @@ int main(int argc, char *argv[]) {
|
|||
{"ignore-empty-password", no_argument, NULL, 'e'},
|
||||
{"inactivity-timeout", required_argument, NULL, 'I'},
|
||||
{"show-failed-attempts", no_argument, NULL, 'f'},
|
||||
{NULL, no_argument, NULL, 0}
|
||||
};
|
||||
{NULL, no_argument, NULL, 0}};
|
||||
|
||||
if ((pw = getpwuid(getuid())) == NULL)
|
||||
err(EXIT_FAILURE, "getpwuid() failed");
|
||||
|
@ -805,8 +802,7 @@ int main(int argc, char *argv[]) {
|
|||
break;
|
||||
default:
|
||||
errx(EXIT_FAILURE, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]"
|
||||
" [-i image.png] [-t] [-e] [-I] [-f]"
|
||||
);
|
||||
" [-i image.png] [-t] [-e] [-I] [-f]");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
3
i3lock.h
3
i3lock.h
|
@ -5,7 +5,8 @@
|
|||
* This is important because xautolock (for example) closes stdout/stderr by
|
||||
* default, so just printing something to stdout will lead to the data ending
|
||||
* up on the X11 socket (!). */
|
||||
#define DEBUG(fmt, ...) do { \
|
||||
#define DEBUG(fmt, ...) \
|
||||
do { \
|
||||
if (debug_mode) \
|
||||
printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
|
|
@ -320,6 +320,7 @@ void redraw_screen(void) {
|
|||
void clear_indicator(void) {
|
||||
if (input_position == 0) {
|
||||
unlock_state = STATE_STARTED;
|
||||
} else unlock_state = STATE_KEY_PRESSED;
|
||||
} else
|
||||
unlock_state = STATE_KEY_PRESSED;
|
||||
redraw_screen();
|
||||
}
|
||||
|
|
7
xcb.c
7
xcb.c
|
@ -67,7 +67,6 @@ xcb_visualtype_t *get_root_visual_type(xcb_screen_t *screen) {
|
|||
for (depth_iter = xcb_screen_allowed_depths_iterator(screen);
|
||||
depth_iter.rem;
|
||||
xcb_depth_next(&depth_iter)) {
|
||||
|
||||
for (visual_iter = xcb_depth_visuals_iterator(depth_iter.data);
|
||||
visual_iter.rem;
|
||||
xcb_visualtype_next(&visual_iter)) {
|
||||
|
@ -188,8 +187,7 @@ void grab_pointer_and_keyboard(xcb_connection_t *conn, xcb_screen_t *screen, xcb
|
|||
XCB_GRAB_MODE_ASYNC, /* keyboard mode */
|
||||
XCB_NONE, /* confine_to = in which window should the cursor stay */
|
||||
cursor, /* we change the cursor to whatever the user wanted */
|
||||
XCB_CURRENT_TIME
|
||||
);
|
||||
XCB_CURRENT_TIME);
|
||||
|
||||
if ((preply = xcb_grab_pointer_reply(conn, pcookie, NULL)) &&
|
||||
preply->status == XCB_GRAB_STATUS_SUCCESS) {
|
||||
|
@ -208,8 +206,7 @@ void grab_pointer_and_keyboard(xcb_connection_t *conn, xcb_screen_t *screen, xcb
|
|||
screen->root, /* grab the root window */
|
||||
XCB_CURRENT_TIME,
|
||||
XCB_GRAB_MODE_ASYNC, /* process events as normal, do not require sync */
|
||||
XCB_GRAB_MODE_ASYNC
|
||||
);
|
||||
XCB_GRAB_MODE_ASYNC);
|
||||
|
||||
if ((kreply = xcb_grab_keyboard_reply(conn, kcookie, NULL)) &&
|
||||
kreply->status == XCB_GRAB_STATUS_SUCCESS) {
|
||||
|
|
Loading…
Reference in a new issue