From e541ba3d876de8ce2812482fc6bfa13b236c6a58 Mon Sep 17 00:00:00 2001 From: Luminarys Date: Tue, 18 Aug 2015 01:33:15 -0500 Subject: Added in basic, but semi-broken moving/resizing functionality to floating windows --- sway/commands.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sway/commands.c') diff --git a/sway/commands.c b/sway/commands.c index 444e6159..f47edd2f 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -171,6 +171,10 @@ static bool cmd_exit(struct sway_config *config, int argc, char **argv) { } static bool cmd_floating(struct sway_config *config, int argc, char **argv) { + if (!checkarg(argc, "floating", EXPECTED_EQUAL_TO, 1)) { + return false; + } + if (strcasecmp(argv[0], "toggle") == 0) { swayc_t *view = get_focused_container(&root_container); // Prevent running floating commands on things like workspaces @@ -241,6 +245,14 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) { return true; } +static bool cmd_floating_mod(struct sway_config *config, int argc, char **argv) { + if (!checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1)) { + return false; + } + config->floating_mod = xkb_keysym_from_name(argv[0], XKB_KEYSYM_CASE_INSENSITIVE); + return true; +} + static bool cmd_focus(struct sway_config *config, int argc, char **argv) { if (!checkarg(argc, "focus", EXPECTED_EQUAL_TO, 1)) { return false; @@ -465,6 +477,7 @@ static struct cmd_handler handlers[] = { { "exec_always", cmd_exec_always }, { "exit", cmd_exit }, { "floating", cmd_floating }, + { "floating_modifier", cmd_floating_mod }, { "focus", cmd_focus }, { "focus_follows_mouse", cmd_focus_follows_mouse }, { "fullscreen", cmd_fullscreen }, -- cgit v1.2.3