diff options
author | Pascal Pascher <pascalpascher@gmx.net> | 2018-07-25 12:17:10 +0200 |
---|---|---|
committer | Pascal Pascher <pascalpascher@gmx.net> | 2018-07-25 12:17:10 +0200 |
commit | 79a45d4a4049e3b9235915cd308ed2995623f833 (patch) | |
tree | 11c0f4b2eb4338b6ace9f519cc21328d68918b8e | |
parent | style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: false (diff) | |
download | sway-79a45d4a4049e3b9235915cd308ed2995623f833.tar.gz sway-79a45d4a4049e3b9235915cd308ed2995623f833.tar.zst sway-79a45d4a4049e3b9235915cd308ed2995623f833.zip |
more style fixes, included "sway/config.h" where needed
-rw-r--r-- | include/sway/server.h | 1 | ||||
-rw-r--r-- | include/sway/xwayland.h | 2 | ||||
-rw-r--r-- | sway/commands/swap.c | 1 | ||||
-rw-r--r-- | sway/criteria.c | 21 | ||||
-rw-r--r-- | sway/input/cursor.c | 1 | ||||
-rw-r--r-- | sway/input/seat.c | 1 | ||||
-rw-r--r-- | sway/tree/layout.c | 1 | ||||
-rw-r--r-- | sway/tree/view.c | 1 |
8 files changed, 17 insertions, 12 deletions
diff --git a/include/sway/server.h b/include/sway/server.h index b6a6bde3..a3782f91 100644 --- a/include/sway/server.h +++ b/include/sway/server.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <wlr/render/wlr_renderer.h> | 12 | #include <wlr/render/wlr_renderer.h> |
13 | // TODO WLR: make Xwayland optional | 13 | // TODO WLR: make Xwayland optional |
14 | #include "list.h" | 14 | #include "list.h" |
15 | #include "config.h" | ||
15 | #ifdef HAVE_XWAYLAND | 16 | #ifdef HAVE_XWAYLAND |
16 | #include "sway/xwayland.h" | 17 | #include "sway/xwayland.h" |
17 | #endif | 18 | #endif |
diff --git a/include/sway/xwayland.h b/include/sway/xwayland.h index e6572ae9..78d1053b 100644 --- a/include/sway/xwayland.h +++ b/include/sway/xwayland.h | |||
@@ -1,4 +1,3 @@ | |||
1 | #ifdef HAVE_XWAYLAND | ||
2 | #ifndef SWAY_XWAYLAND_H | 1 | #ifndef SWAY_XWAYLAND_H |
3 | #define SWAY_XWAYLAND_H | 2 | #define SWAY_XWAYLAND_H |
4 | 3 | ||
@@ -24,4 +23,3 @@ struct sway_xwayland { | |||
24 | void handle_xwayland_ready(struct wl_listener *listener, void *data); | 23 | void handle_xwayland_ready(struct wl_listener *listener, void *data); |
25 | 24 | ||
26 | #endif | 25 | #endif |
27 | #endif | ||
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 325adc38..8b8e9d79 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <strings.h> | 1 | #include <strings.h> |
2 | #include <wlr/util/log.h> | 2 | #include <wlr/util/log.h> |
3 | #include "sway/config.h" | ||
3 | #include "sway/commands.h" | 4 | #include "sway/commands.h" |
4 | #include "sway/tree/arrange.h" | 5 | #include "sway/tree/arrange.h" |
5 | #include "sway/tree/layout.h" | 6 | #include "sway/tree/layout.h" |
diff --git a/sway/criteria.c b/sway/criteria.c index b2c6edf9..48899125 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include "stringop.h" | 10 | #include "stringop.h" |
11 | #include "list.h" | 11 | #include "list.h" |
12 | #include "log.h" | 12 | #include "log.h" |
13 | #include "config.h" | ||
13 | 14 | ||
14 | bool criteria_is_empty(struct criteria *criteria) { | 15 | bool criteria_is_empty(struct criteria *criteria) { |
15 | return !criteria->title | 16 | return !criteria->title |
@@ -19,9 +20,9 @@ bool criteria_is_empty(struct criteria *criteria) { | |||
19 | && !criteria->instance | 20 | && !criteria->instance |
20 | && !criteria->con_mark | 21 | && !criteria->con_mark |
21 | && !criteria->con_id | 22 | && !criteria->con_id |
22 | #ifdef HAVE_XWAYLAND | 23 | #ifdef HAVE_XWAYLAND |
23 | && !criteria->id | 24 | && !criteria->id |
24 | #endif | 25 | #endif |
25 | && !criteria->window_role | 26 | && !criteria->window_role |
26 | && !criteria->window_type | 27 | && !criteria->window_type |
27 | && !criteria->floating | 28 | && !criteria->floating |
@@ -129,14 +130,14 @@ static bool criteria_matches_view(struct criteria *criteria, | |||
129 | } | 130 | } |
130 | } | 131 | } |
131 | 132 | ||
132 | #ifdef HAVE_XWAYLAND | 133 | #ifdef HAVE_XWAYLAND |
133 | if (criteria->id) { // X11 window ID | 134 | if (criteria->id) { // X11 window ID |
134 | uint32_t x11_window_id = view_get_x11_window_id(view); | 135 | uint32_t x11_window_id = view_get_x11_window_id(view); |
135 | if (!x11_window_id || x11_window_id != criteria->id) { | 136 | if (!x11_window_id || x11_window_id != criteria->id) { |
136 | return false; | 137 | return false; |
137 | } | 138 | } |
138 | } | 139 | } |
139 | #endif | 140 | #endif |
140 | 141 | ||
141 | if (criteria->window_role) { | 142 | if (criteria->window_role) { |
142 | // TODO | 143 | // TODO |
@@ -293,10 +294,10 @@ static enum criteria_token token_from_name(char *name) { | |||
293 | return T_CON_ID; | 294 | return T_CON_ID; |
294 | } else if (strcmp(name, "con_mark") == 0) { | 295 | } else if (strcmp(name, "con_mark") == 0) { |
295 | return T_CON_MARK; | 296 | return T_CON_MARK; |
296 | #ifdef HAVE_XWAYLAND | 297 | #ifdef HAVE_XWAYLAND |
297 | } else if (strcmp(name, "id") == 0) { | 298 | } else if (strcmp(name, "id") == 0) { |
298 | return T_ID; | 299 | return T_ID; |
299 | #endif | 300 | #endif |
300 | } else if (strcmp(name, "instance") == 0) { | 301 | } else if (strcmp(name, "instance") == 0) { |
301 | return T_INSTANCE; | 302 | return T_INSTANCE; |
302 | } else if (strcmp(name, "shell") == 0) { | 303 | } else if (strcmp(name, "shell") == 0) { |
@@ -363,9 +364,9 @@ static char *get_focused_prop(enum criteria_token token) { | |||
363 | case T_CON_ID: // These do not support __focused__ | 364 | case T_CON_ID: // These do not support __focused__ |
364 | case T_CON_MARK: | 365 | case T_CON_MARK: |
365 | case T_FLOATING: | 366 | case T_FLOATING: |
366 | #ifdef HAVE_XWAYLAND | 367 | #ifdef HAVE_XWAYLAND |
367 | case T_ID: | 368 | case T_ID: |
368 | #endif | 369 | #endif |
369 | case T_TILING: | 370 | case T_TILING: |
370 | case T_URGENT: | 371 | case T_URGENT: |
371 | case T_WINDOW_TYPE: | 372 | case T_WINDOW_TYPE: |
@@ -436,14 +437,14 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) { | |||
436 | case T_WINDOW_TYPE: | 437 | case T_WINDOW_TYPE: |
437 | // TODO: This is a string but will be stored as an enum or integer | 438 | // TODO: This is a string but will be stored as an enum or integer |
438 | break; | 439 | break; |
439 | #ifdef HAVE_XWAYLAND | 440 | #ifdef HAVE_XWAYLAND |
440 | case T_ID: | 441 | case T_ID: |
441 | criteria->id = strtoul(effective_value, &endptr, 10); | 442 | criteria->id = strtoul(effective_value, &endptr, 10); |
442 | if (*endptr != 0) { | 443 | if (*endptr != 0) { |
443 | error = strdup("The value for 'id' should be numeric"); | 444 | error = strdup("The value for 'id' should be numeric"); |
444 | } | 445 | } |
445 | break; | 446 | break; |
446 | #endif | 447 | #endif |
447 | case T_FLOATING: | 448 | case T_FLOATING: |
448 | criteria->floating = true; | 449 | criteria->floating = true; |
449 | break; | 450 | break; |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 33eebf97..3de36e1c 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <wlr/types/wlr_idle.h> | 11 | #include <wlr/types/wlr_idle.h> |
12 | #include "list.h" | 12 | #include "list.h" |
13 | #include "log.h" | 13 | #include "log.h" |
14 | #include "sway/config.h" | ||
14 | #include "sway/desktop.h" | 15 | #include "sway/desktop.h" |
15 | #include "sway/desktop/transaction.h" | 16 | #include "sway/desktop/transaction.h" |
16 | #include "sway/input/cursor.h" | 17 | #include "sway/input/cursor.h" |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 6b4e5f2e..2d62b101 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <wlr/types/wlr_output_layout.h> | 12 | #include <wlr/types/wlr_output_layout.h> |
13 | #include <wlr/types/wlr_xcursor_manager.h> | 13 | #include <wlr/types/wlr_xcursor_manager.h> |
14 | #include "log.h" | 14 | #include "log.h" |
15 | #include "sway/config.h" | ||
15 | #include "sway/debug.h" | 16 | #include "sway/debug.h" |
16 | #include "sway/desktop.h" | 17 | #include "sway/desktop.h" |
17 | #include "sway/input/cursor.h" | 18 | #include "sway/input/cursor.h" |
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 3d361ea5..91f6accd 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <wlr/types/wlr_output.h> | 7 | #include <wlr/types/wlr_output.h> |
8 | #include <wlr/types/wlr_output_layout.h> | 8 | #include <wlr/types/wlr_output_layout.h> |
9 | #include "sway/config.h" | ||
9 | #include "sway/debug.h" | 10 | #include "sway/debug.h" |
10 | #include "sway/tree/arrange.h" | 11 | #include "sway/tree/arrange.h" |
11 | #include "sway/tree/container.h" | 12 | #include "sway/tree/container.h" |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 2eff80a8..7cc15ae3 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <wayland-server.h> | 3 | #include <wayland-server.h> |
4 | #include <wlr/render/wlr_renderer.h> | 4 | #include <wlr/render/wlr_renderer.h> |
5 | #include <wlr/types/wlr_output_layout.h> | 5 | #include <wlr/types/wlr_output_layout.h> |
6 | #include "sway/config.h" | ||
6 | #ifdef HAVE_XWAYLAND | 7 | #ifdef HAVE_XWAYLAND |
7 | #include <wlr/xwayland.h> | 8 | #include <wlr/xwayland.h> |
8 | #endif | 9 | #endif |