diff options
author | Taiyu <taiyu.len@gmail.com> | 2015-08-11 00:36:31 -0700 |
---|---|---|
committer | Taiyu <taiyu.len@gmail.com> | 2015-08-11 00:36:31 -0700 |
commit | 4e33a9b23c7a342a752852460abf2c1e3875b8b4 (patch) | |
tree | 7a0819e9806f87a07a2f361ca33be28908ffd363 | |
parent | removed old code (diff) | |
download | sway-4e33a9b23c7a342a752852460abf2c1e3875b8b4.tar.gz sway-4e33a9b23c7a342a752852460abf2c1e3875b8b4.tar.zst sway-4e33a9b23c7a342a752852460abf2c1e3875b8b4.zip |
define -> enum
-rw-r--r-- | sway/handlers.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 8fc299f4..65e6a7a2 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -55,17 +55,16 @@ void handle_view_geometry_request(wlc_handle view, const struct wlc_geometry* ge | |||
55 | // deny that shit | 55 | // deny that shit |
56 | } | 56 | } |
57 | 57 | ||
58 | enum { QSIZE = 32 }; | ||
58 | 59 | ||
59 | bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers | 60 | bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers |
60 | *modifiers, uint32_t key, uint32_t sym, enum wlc_key_state state) { | 61 | *modifiers, uint32_t key, uint32_t sym, enum wlc_key_state state) { |
61 | #define QSIZE 32 | ||
62 | static uint8_t head = 0; | 62 | static uint8_t head = 0; |
63 | static uint32_t array[QSIZE]; | 63 | static uint32_t array[QSIZE]; |
64 | 64 | ||
65 | struct sway_mode *mode = config->current_mode; | 65 | struct sway_mode *mode = config->current_mode; |
66 | // Lowercase if necessary | 66 | // Lowercase if necessary |
67 | sym = tolower(sym); | 67 | sym = tolower(sym); |
68 | |||
69 | //Add or remove key to array | 68 | //Add or remove key to array |
70 | if (state == WLC_KEY_STATE_PRESSED && head + 1 < QSIZE) { | 69 | if (state == WLC_KEY_STATE_PRESSED && head + 1 < QSIZE) { |
71 | array[head++] = sym; | 70 | array[head++] = sym; |
@@ -120,7 +119,6 @@ bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers | |||
120 | } | 119 | } |
121 | } | 120 | } |
122 | return true; | 121 | return true; |
123 | #undef Q_SIZE | ||
124 | } | 122 | } |
125 | 123 | ||
126 | bool pointer_test(swayc_t *view, void *_origin) { | 124 | bool pointer_test(swayc_t *view, void *_origin) { |