From 76b64f6a854bb722a8b0b313b94a14648702506d Mon Sep 17 00:00:00 2001 From: Willow Barraco Date: Fri, 8 Sep 2023 23:22:56 +0200 Subject: [PATCH] Fix builds --- .clang-format | 1 + keyboard.c | 24 +++++++++++------------- main.c | 8 ++++---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.clang-format b/.clang-format index d0f20d0..eecebd7 100644 --- a/.clang-format +++ b/.clang-format @@ -2,3 +2,4 @@ BasedOnStyle: LLVM IndentWidth: 4 AlwaysBreakAfterDefinitionReturnType: All BreakBeforeBraces: Linux +SortIncludes: false diff --git a/keyboard.c b/keyboard.c index fe91bff..9b29367 100644 --- a/keyboard.c +++ b/keyboard.c @@ -1,11 +1,11 @@ -#include "keyboard.h" -#include "drw.h" -#include "os-compatibility.h" #include "proto/virtual-keyboard-unstable-v1-client-protocol.h" #include #include #include #include +#include "keyboard.h" +#include "drw.h" +#include "os-compatibility.h" #define MAX_LAYERS 25 @@ -52,8 +52,8 @@ kbd_next_layer(struct kbd *kb, struct key *k, bool invert) layer_index = 0; kb->mods = 0; } else if ((kb->mods & Shift) || (kb->mods & CapsLock) || (invert)) { - // with modifiers shift/capslock or invert set: switch to the - // previous layout in the layer sequence + // with modifiers shift/capslock or invert set: switch to the previous + // layout in the layer sequence if (layer_index > 0) { layer_index--; } else { @@ -72,8 +72,7 @@ kbd_next_layer(struct kbd *kb, struct key *k, bool invert) if (!invert) kb->mods ^= Shift; } else { - // normal behaviour: switch to the next layout in the layer - // sequence + // normal behaviour: switch to the next layout in the layer sequence layer_index++; } size_t layercount = 0; @@ -443,8 +442,7 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) } break; case Compose: - // switch to the associated layout determined by the *next* - // keypress + // switch to the associated layout determined by the *next* keypress if (kb->compose == 0) { kb->compose = 1; } else { @@ -456,8 +454,8 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) kbd_draw_key(kb, k, Unpress); } break; - case NextLayer: //(also handles previous layer when shift modifier is - // on, or "first layer" with other modifiers) + case NextLayer: //(also handles previous layer when shift modifier is on, or + //"first layer" with other modifiers) kbd_next_layer(kb, k, false); break; case BackLayer: // triggered when "Abc" keys are pressed @@ -465,8 +463,8 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) if (kb->last_abc_layout) { kb->compose = 0; kbd_switch_layout(kb, kb->last_abc_layout, kb->last_abc_index); - // reset previous layout to default/first so we don't get - // any weird cycles + // reset previous layout to default/first so we don't get any weird + // cycles kb->last_abc_index = 0; if (kb->landscape) { kb->last_abc_layout = &kb->layouts[kb->landscape_layers[0]]; diff --git a/main.c b/main.c index 8ee5f24..01452c3 100644 --- a/main.c +++ b/main.c @@ -1,22 +1,22 @@ -#include "proto/fractional-scale-v1-client-protocol.h" -#include "proto/viewporter-client-protocol.h" #include "proto/virtual-keyboard-unstable-v1-client-protocol.h" #include "proto/wlr-layer-shell-unstable-v1-client-protocol.h" #include "proto/xdg-shell-client-protocol.h" +#include "proto/fractional-scale-v1-client-protocol.h" +#include "proto/viewporter-client-protocol.h" #include -#include #include #include #include #include #include +#include #include #include #include #include -#include "config.h" #include "keyboard.h" +#include "config.h" /* lazy die macro */ #define die(...) \