aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/swap.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-25 08:27:40 -0400
committerGitHub <noreply@github.com>2018-07-25 08:27:40 -0400
commitfc718f629af231f8a0ae795b2f7529e213cab183 (patch)
tree7917aadbfb09d02d3d60045f0ba8d5028f0c4bb4 /sway/commands/swap.c
parentfd1e2c172c12b5c5a3adac8e6de4009697bd7567 (diff)
parent384c55c0b465d6b9a9c4cb88d8752435ac5cf708 (diff)
Merge pull request #2350 from ppascher/xwayland-optional
Added meson option to allow building sway without xwayland support
Diffstat (limited to 'sway/commands/swap.c')
-rw-r--r--sway/commands/swap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/commands/swap.c b/sway/commands/swap.c
index 2fc88308..4e3a9cce 100644
--- a/sway/commands/swap.c
+++ b/sway/commands/swap.c
@@ -1,5 +1,6 @@
#include <strings.h>
#include <wlr/util/log.h>
+#include "config.h"
#include "sway/commands.h"
#include "sway/tree/arrange.h"
#include "sway/tree/layout.h"
@@ -14,10 +15,14 @@ static bool test_con_id(struct sway_container *container, void *con_id) {
}
static bool test_id(struct sway_container *container, void *id) {
+#ifdef HAVE_XWAYLAND
xcb_window_t *wid = id;
return (container->type == C_VIEW
&& container->sway_view->type == SWAY_VIEW_XWAYLAND
&& container->sway_view->wlr_xwayland_surface->window_id == *wid);
+#else
+ return false;
+#endif
}
static bool test_mark(struct sway_container *container, void *mark) {
@@ -43,8 +48,10 @@ struct cmd_results *cmd_swap(int argc, char **argv) {
char *value = join_args(argv + 3, argc - 3);
if (strcasecmp(argv[2], "id") == 0) {
+#ifdef HAVE_XWAYLAND
xcb_window_t id = strtol(value, NULL, 0);
other = container_find(&root_container, test_id, (void *)&id);
+#endif
} else if (strcasecmp(argv[2], "con_id") == 0) {
size_t con_id = atoi(value);
other = container_find(&root_container, test_con_id, (void *)con_id);