From a9c09932188be010967dd9c78f1a0c5381f3ba63 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Wed, 31 Aug 2016 21:07:20 -0500 Subject: [PATCH 1/5] document `orientation` command --- sway/sway.5.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/sway.5.txt b/sway/sway.5.txt index 7de02a828..84e5e7c5f 100644 --- a/sway/sway.5.txt +++ b/sway/sway.5.txt @@ -39,6 +39,9 @@ The following commands may only be used in the configuration file. **set** :: Sets variable $name to _value_. You can use the new variable in the arguments of future commands. + +**orientation** :: + Sets the default container layout for tiled containers. The following commands cannot be used directly in the configuration file. They are expected to be used with **bindsym** or at runtime through **swaymsg**(1). From 8c5e84c79d817f67a8fd72f28d576e44f518073a Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Thu, 1 Sep 2016 08:40:26 +0200 Subject: [PATCH 2/5] Add Fedora official packages mention :) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4ea135e7b..fc086bb18 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Sway is not supported by many distributions yet. Here's a list of packages available for you to install: * [Arch Linux](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#arch) +* [Fedora](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#fedora) * [Gentoo](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#gentoo) * [NixOS](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#nixos) * [openSUSE Tumbleweed](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#opensuse) From 416417a54c5875abcdc257b6ad10ff086c35eefc Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Sep 2016 08:18:37 -0400 Subject: [PATCH 3/5] Reorganize includes --- common/ipc-client.c | 11 +++--- common/log.c | 16 ++++----- common/util.c | 7 ++-- include/{ => sway}/border.h | 0 include/{ => sway}/commands.h | 0 include/{ => sway}/config.h | 0 include/{ => sway}/container.h | 0 include/{ => sway}/criteria.h | 0 include/{ => sway}/extensions.h | 0 include/{ => sway}/focus.h | 0 include/{ => sway}/handlers.h | 0 include/{ => sway}/input.h | 0 include/{ => sway}/input_state.h | 0 include/{ => sway}/ipc-json.h | 0 include/{ => sway}/ipc-server.h | 0 include/{ => sway}/layout.h | 0 include/{ => sway}/output.h | 0 include/{ => sway}/resize.h | 0 include/{ => sway}/workspace.h | 0 include/{bar => swaybar}/bar.h | 0 include/{bar => swaybar}/config.h | 0 include/{bar => swaybar}/ipc.h | 0 include/{bar => swaybar}/render.h | 0 include/{bar => swaybar}/status_line.h | 0 include/{lock/lock.h => swaylock/swaylock.h} | 0 sway/border.c | 6 ++-- sway/commands.c | 30 ++++++++--------- sway/config.c | 14 ++++---- sway/container.c | 20 +++++------ sway/criteria.c | 6 ++-- sway/debug_log.c | 2 +- sway/extensions.c | 8 ++--- sway/focus.c | 15 ++++----- sway/handlers.c | 35 ++++++++++---------- sway/input.c | 4 +-- sway/input_state.c | 5 ++- sway/ipc-json.c | 4 +-- sway/ipc-server.c | 14 ++++---- sway/layout.c | 20 +++++------ sway/main.c | 18 +++++----- sway/output.c | 2 +- sway/resize.c | 10 +++--- sway/workspace.c | 20 +++++------ swaybar/bar.c | 11 +++--- swaybar/config.c | 2 +- swaybar/ipc.c | 5 ++- swaybar/main.c | 2 +- swaybar/render.c | 6 ++-- swaybar/status_line.c | 4 +-- swaylock/main.c | 3 +- 50 files changed, 146 insertions(+), 154 deletions(-) rename include/{ => sway}/border.h (100%) rename include/{ => sway}/commands.h (100%) rename include/{ => sway}/config.h (100%) rename include/{ => sway}/container.h (100%) rename include/{ => sway}/criteria.h (100%) rename include/{ => sway}/extensions.h (100%) rename include/{ => sway}/focus.h (100%) rename include/{ => sway}/handlers.h (100%) rename include/{ => sway}/input.h (100%) rename include/{ => sway}/input_state.h (100%) rename include/{ => sway}/ipc-json.h (100%) rename include/{ => sway}/ipc-server.h (100%) rename include/{ => sway}/layout.h (100%) rename include/{ => sway}/output.h (100%) rename include/{ => sway}/resize.h (100%) rename include/{ => sway}/workspace.h (100%) rename include/{bar => swaybar}/bar.h (100%) rename include/{bar => swaybar}/config.h (100%) rename include/{bar => swaybar}/ipc.h (100%) rename include/{bar => swaybar}/render.h (100%) rename include/{bar => swaybar}/status_line.h (100%) rename include/{lock/lock.h => swaylock/swaylock.h} (100%) diff --git a/common/ipc-client.c b/common/ipc-client.c index e155c168e..106f9d86a 100644 --- a/common/ipc-client.c +++ b/common/ipc-client.c @@ -1,16 +1,13 @@ +#include #include #include #include -#include -#include -#include #include +#include #include -#include "log.h" -#include "stringop.h" -#include "ipc.h" -#include "readline.h" #include "ipc-client.h" +#include "readline.h" +#include "log.h" static const char ipc_magic[] = {'i', '3', '-', 'i', 'p', 'c'}; static const size_t ipc_header_size = sizeof(ipc_magic)+8; diff --git a/common/log.c b/common/log.c index 1da2ba2ff..4f0baa3f7 100644 --- a/common/log.c +++ b/common/log.c @@ -1,17 +1,15 @@ -#include "log.h" -#include "sway.h" -#include "readline.h" +#include +#include +#include #include #include #include -#include -#include #include -#include -#include -#include #include -#include +#include +#include "log.h" +#include "sway.h" +#include "readline.h" static int colored = 1; static log_importance_t loglevel_default = L_ERROR; diff --git a/common/util.c b/common/util.c index f0b0fdf0d..f23026767 100644 --- a/common/util.c +++ b/common/util.c @@ -1,10 +1,13 @@ #include +#include #include -#include #include +#include +#include +#include +#include "log.h" #include "readline.h" #include "util.h" -#include "log.h" int wrap(int i, int max) { return ((i % max) + max) % max; diff --git a/include/border.h b/include/sway/border.h similarity index 100% rename from include/border.h rename to include/sway/border.h diff --git a/include/commands.h b/include/sway/commands.h similarity index 100% rename from include/commands.h rename to include/sway/commands.h diff --git a/include/config.h b/include/sway/config.h similarity index 100% rename from include/config.h rename to include/sway/config.h diff --git a/include/container.h b/include/sway/container.h similarity index 100% rename from include/container.h rename to include/sway/container.h diff --git a/include/criteria.h b/include/sway/criteria.h similarity index 100% rename from include/criteria.h rename to include/sway/criteria.h diff --git a/include/extensions.h b/include/sway/extensions.h similarity index 100% rename from include/extensions.h rename to include/sway/extensions.h diff --git a/include/focus.h b/include/sway/focus.h similarity index 100% rename from include/focus.h rename to include/sway/focus.h diff --git a/include/handlers.h b/include/sway/handlers.h similarity index 100% rename from include/handlers.h rename to include/sway/handlers.h diff --git a/include/input.h b/include/sway/input.h similarity index 100% rename from include/input.h rename to include/sway/input.h diff --git a/include/input_state.h b/include/sway/input_state.h similarity index 100% rename from include/input_state.h rename to include/sway/input_state.h diff --git a/include/ipc-json.h b/include/sway/ipc-json.h similarity index 100% rename from include/ipc-json.h rename to include/sway/ipc-json.h diff --git a/include/ipc-server.h b/include/sway/ipc-server.h similarity index 100% rename from include/ipc-server.h rename to include/sway/ipc-server.h diff --git a/include/layout.h b/include/sway/layout.h similarity index 100% rename from include/layout.h rename to include/sway/layout.h diff --git a/include/output.h b/include/sway/output.h similarity index 100% rename from include/output.h rename to include/sway/output.h diff --git a/include/resize.h b/include/sway/resize.h similarity index 100% rename from include/resize.h rename to include/sway/resize.h diff --git a/include/workspace.h b/include/sway/workspace.h similarity index 100% rename from include/workspace.h rename to include/sway/workspace.h diff --git a/include/bar/bar.h b/include/swaybar/bar.h similarity index 100% rename from include/bar/bar.h rename to include/swaybar/bar.h diff --git a/include/bar/config.h b/include/swaybar/config.h similarity index 100% rename from include/bar/config.h rename to include/swaybar/config.h diff --git a/include/bar/ipc.h b/include/swaybar/ipc.h similarity index 100% rename from include/bar/ipc.h rename to include/swaybar/ipc.h diff --git a/include/bar/render.h b/include/swaybar/render.h similarity index 100% rename from include/bar/render.h rename to include/swaybar/render.h diff --git a/include/bar/status_line.h b/include/swaybar/status_line.h similarity index 100% rename from include/bar/status_line.h rename to include/swaybar/status_line.h diff --git a/include/lock/lock.h b/include/swaylock/swaylock.h similarity index 100% rename from include/lock/lock.h rename to include/swaylock/swaylock.h diff --git a/sway/border.c b/sway/border.c index 5cb022742..65f694114 100644 --- a/sway/border.c +++ b/sway/border.c @@ -1,12 +1,12 @@ -#include "border.h" #include #include #include #include #include #include -#include "container.h" -#include "config.h" +#include "sway/border.h" +#include "sway/container.h" +#include "sway/config.h" #include "client/pango.h" void cairo_set_source_u32(cairo_t *cairo, uint32_t color) { diff --git a/sway/commands.c b/sway/commands.c index 5a5bcd220..347b463b3 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -16,24 +16,24 @@ #include #include #include +#include "sway/layout.h" +#include "sway/focus.h" +#include "sway/workspace.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/output.h" +#include "sway/handlers.h" +#include "sway/resize.h" +#include "sway/input_state.h" +#include "sway/criteria.h" +#include "sway/ipc-server.h" +#include "sway/input.h" +#include "sway/border.h" #include "stringop.h" -#include "layout.h" -#include "focus.h" -#include "log.h" -#include "util.h" -#include "workspace.h" -#include "commands.h" -#include "container.h" -#include "output.h" -#include "handlers.h" #include "sway.h" -#include "resize.h" -#include "input_state.h" -#include "criteria.h" -#include "ipc-server.h" +#include "util.h" #include "list.h" -#include "input.h" -#include "border.h" +#include "log.h" typedef struct cmd_results *sway_cmd(int argc, char **argv); diff --git a/sway/config.c b/sway/config.c index bed233bdb..a187fe3ef 100644 --- a/sway/config.c +++ b/sway/config.c @@ -12,17 +12,17 @@ #include #include #include "wayland-desktop-shell-server-protocol.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/layout.h" +#include "sway/input_state.h" +#include "sway/criteria.h" +#include "sway/input.h" +#include "sway/border.h" #include "readline.h" #include "stringop.h" #include "list.h" #include "log.h" -#include "commands.h" -#include "config.h" -#include "layout.h" -#include "input_state.h" -#include "criteria.h" -#include "input.h" -#include "border.h" struct sway_config *config = NULL; diff --git a/sway/container.c b/sway/container.c index c922bac3b..5614293c7 100644 --- a/sway/container.c +++ b/sway/container.c @@ -3,17 +3,17 @@ #include #include #include -#include "config.h" -#include "stringop.h" -#include "container.h" -#include "workspace.h" -#include "focus.h" -#include "border.h" -#include "layout.h" -#include "input_state.h" +#include "sway/config.h" +#include "sway/container.h" +#include "sway/workspace.h" +#include "sway/focus.h" +#include "sway/border.h" +#include "sway/layout.h" +#include "sway/input_state.h" +#include "sway/ipc-server.h" +#include "sway/output.h" #include "log.h" -#include "ipc-server.h" -#include "output.h" +#include "stringop.h" #define ASSERT_NONNULL(PTR) \ sway_assert (PTR, #PTR "must be non-null") diff --git a/sway/criteria.c b/sway/criteria.c index 53435d294..739a183e8 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -2,12 +2,12 @@ #include #include #include -#include "criteria.h" +#include "sway/criteria.h" +#include "sway/container.h" +#include "sway/config.h" #include "stringop.h" #include "list.h" #include "log.h" -#include "container.h" -#include "config.h" enum criteria_type { // *must* keep in sync with criteria_strings[] CRIT_CLASS, diff --git a/sway/debug_log.c b/sway/debug_log.c index 7c9884647..8d891a44b 100644 --- a/sway/debug_log.c +++ b/sway/debug_log.c @@ -10,7 +10,7 @@ #include #include #include -#include "workspace.h" +#include "sway/workspace.h" /* XXX:DEBUG:XXX */ static void container_log(const swayc_t *c, int depth) { diff --git a/sway/extensions.c b/sway/extensions.c index 4611f33ef..70ec537d2 100644 --- a/sway/extensions.c +++ b/sway/extensions.c @@ -4,11 +4,11 @@ #include #include "wayland-desktop-shell-server-protocol.h" #include "wayland-swaylock-server-protocol.h" -#include "layout.h" +#include "sway/layout.h" +#include "sway/input_state.h" +#include "sway/extensions.h" +#include "sway/ipc-server.h" #include "log.h" -#include "input_state.h" -#include "extensions.h" -#include "ipc-server.h" struct desktop_shell_state desktop_shell; diff --git a/sway/focus.c b/sway/focus.c index 145e55841..9207260dc 100644 --- a/sway/focus.c +++ b/sway/focus.c @@ -1,13 +1,12 @@ #include - -#include "focus.h" +#include "sway/focus.h" +#include "sway/workspace.h" +#include "sway/layout.h" +#include "sway/config.h" +#include "sway/input_state.h" +#include "sway/ipc-server.h" +#include "sway/border.h" #include "log.h" -#include "workspace.h" -#include "layout.h" -#include "config.h" -#include "input_state.h" -#include "ipc-server.h" -#include "border.h" bool locked_container_focus = false; bool suspend_workspace_cleanup = false; diff --git a/sway/handlers.c b/sway/handlers.c index 846d0005a..47af7bd5f 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -7,25 +7,24 @@ #include #include #include - -#include "handlers.h" -#include "border.h" -#include "log.h" -#include "layout.h" -#include "config.h" -#include "commands.h" -#include "stringop.h" -#include "workspace.h" -#include "container.h" -#include "output.h" -#include "focus.h" -#include "input_state.h" -#include "resize.h" -#include "extensions.h" -#include "criteria.h" -#include "ipc-server.h" +#include "sway/handlers.h" +#include "sway/border.h" +#include "sway/layout.h" +#include "sway/config.h" +#include "sway/commands.h" +#include "sway/workspace.h" +#include "sway/container.h" +#include "sway/output.h" +#include "sway/focus.h" +#include "sway/input_state.h" +#include "sway/resize.h" +#include "sway/extensions.h" +#include "sway/criteria.h" +#include "sway/ipc-server.h" +#include "sway/input.h" #include "list.h" -#include "input.h" +#include "stringop.h" +#include "log.h" // Event should be sent to client #define EVENT_PASSTHROUGH false diff --git a/sway/input.c b/sway/input.c index 1f3e99e7e..ae24cb497 100644 --- a/sway/input.c +++ b/sway/input.c @@ -4,8 +4,8 @@ #include #include #include -#include "config.h" -#include "input.h" +#include "sway/config.h" +#include "sway/input.h" #include "list.h" #include "log.h" diff --git a/sway/input_state.c b/sway/input_state.c index 7e31d3d9e..68df17de5 100644 --- a/sway/input_state.c +++ b/sway/input_state.c @@ -1,10 +1,9 @@ #include #include #include +#include "sway/input_state.h" +#include "sway/config.h" #include "log.h" -#include "config.h" - -#include "input_state.h" #define KEY_STATE_MAX_LENGTH 64 diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 1debca7bc..3f03b9f1b 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -2,9 +2,9 @@ #include #include #include -#include "container.h" +#include "sway/container.h" +#include "sway/ipc-json.h" #include "util.h" -#include "ipc-json.h" static json_object *ipc_json_create_rect(swayc_t *c) { json_object *rect = json_object_new_object(); diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 7039e348d..70007f57e 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -13,15 +13,15 @@ #include #include #include -#include "ipc-json.h" -#include "ipc-server.h" -#include "log.h" -#include "config.h" -#include "commands.h" -#include "list.h" +#include "sway/ipc-json.h" +#include "sway/ipc-server.h" +#include "sway/config.h" +#include "sway/commands.h" +#include "sway/input.h" #include "stringop.h" +#include "log.h" +#include "list.h" #include "util.h" -#include "input.h" static int ipc_socket = -1; static struct wlc_event_source *ipc_event_source = NULL; diff --git a/sway/layout.c b/sway/layout.c index 01c8e4e3c..cf6a111e8 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -2,17 +2,17 @@ #include #include #include -#include "extensions.h" -#include "log.h" +#include "sway/extensions.h" +#include "sway/config.h" +#include "sway/container.h" +#include "sway/workspace.h" +#include "sway/focus.h" +#include "sway/output.h" +#include "sway/ipc-server.h" +#include "sway/border.h" +#include "sway/layout.h" #include "list.h" -#include "config.h" -#include "container.h" -#include "workspace.h" -#include "focus.h" -#include "output.h" -#include "ipc-server.h" -#include "border.h" -#include "layout.h" +#include "log.h" swayc_t root_container; list_t *scratchpad; diff --git a/sway/main.c b/sway/main.c index 51b12d203..972b260b5 100644 --- a/sway/main.c +++ b/sway/main.c @@ -8,17 +8,17 @@ #include #include #include -#include "extensions.h" -#include "layout.h" -#include "stringop.h" -#include "config.h" -#include "log.h" -#include "readline.h" -#include "handlers.h" +#include "sway/extensions.h" +#include "sway/layout.h" +#include "sway/config.h" +#include "sway/handlers.h" +#include "sway/input.h" +#include "sway/ipc-server.h" #include "ipc-client.h" -#include "ipc-server.h" -#include "input.h" +#include "readline.h" +#include "stringop.h" #include "sway.h" +#include "log.h" static bool terminate_request = false; static int exit_value = 0; diff --git a/sway/output.c b/sway/output.c index 97b8a4a6d..b337b143f 100644 --- a/sway/output.c +++ b/sway/output.c @@ -1,7 +1,7 @@ #include #include #include -#include "output.h" +#include "sway/output.h" #include "log.h" #include "list.h" diff --git a/sway/resize.c b/sway/resize.c index 18bb86bb2..b32d24313 100644 --- a/sway/resize.c +++ b/sway/resize.c @@ -1,11 +1,11 @@ #include #include -#include "layout.h" -#include "focus.h" +#include "sway/layout.h" +#include "sway/focus.h" +#include "sway/input_state.h" +#include "sway/handlers.h" +#include "sway/resize.h" #include "log.h" -#include "input_state.h" -#include "handlers.h" -#include "resize.h" static bool set_size_floating(int new_dimension, bool use_width) { swayc_t *view = get_focused_float(swayc_active_workspace()); diff --git a/sway/workspace.c b/sway/workspace.c index 9c3e69a95..7b24d7d99 100644 --- a/sway/workspace.c +++ b/sway/workspace.c @@ -6,18 +6,18 @@ #include #include #include -#include "ipc-server.h" -#include "extensions.h" -#include "workspace.h" -#include "layout.h" +#include "sway/ipc-server.h" +#include "sway/extensions.h" +#include "sway/workspace.h" +#include "sway/layout.h" +#include "sway/container.h" +#include "sway/handlers.h" +#include "sway/config.h" +#include "sway/focus.h" +#include "stringop.h" +#include "util.h" #include "list.h" #include "log.h" -#include "container.h" -#include "handlers.h" -#include "config.h" -#include "stringop.h" -#include "focus.h" -#include "util.h" #include "ipc.h" char *prev_workspace_name = NULL; diff --git a/swaybar/bar.c b/swaybar/bar.c index e3e536227..c6596864a 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -5,15 +5,14 @@ #include #include #include - +#include "swaybar/ipc.h" +#include "swaybar/render.h" +#include "swaybar/config.h" +#include "swaybar/status_line.h" +#include "swaybar/bar.h" #include "ipc-client.h" #include "list.h" #include "log.h" -#include "bar/ipc.h" -#include "bar/render.h" -#include "bar/config.h" -#include "bar/status_line.h" -#include "bar/bar.h" static void bar_init(struct bar *bar) { bar->config = init_config(); diff --git a/swaybar/config.c b/swaybar/config.c index b5dca668e..c5437ee7e 100644 --- a/swaybar/config.c +++ b/swaybar/config.c @@ -3,7 +3,7 @@ #include "wayland-desktop-shell-client-protocol.h" #include "log.h" -#include "bar/config.h" +#include "swaybar/config.h" uint32_t parse_position(const char *position) { if (strcmp("top", position) == 0) { diff --git a/swaybar/ipc.c b/swaybar/ipc.c index ad4f9ef88..8d62d2236 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -1,11 +1,10 @@ #include #include - +#include "swaybar/config.h" +#include "swaybar/ipc.h" #include "ipc-client.h" #include "list.h" #include "log.h" -#include "bar/config.h" -#include "bar/ipc.h" void ipc_send_workspace_command(const char *workspace_name) { uint32_t size = strlen("workspace ") + strlen(workspace_name) + 1; diff --git a/swaybar/main.c b/swaybar/main.c index d7534f5da..c9a554a37 100644 --- a/swaybar/main.c +++ b/swaybar/main.c @@ -3,9 +3,9 @@ #include #include #include +#include "swaybar/bar.h" #include "ipc-client.h" #include "log.h" -#include "bar/bar.h" /* global bar state */ struct bar swaybar; diff --git a/swaybar/render.c b/swaybar/render.c index cea36f525..83b4cec72 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -5,9 +5,9 @@ #include "client/cairo.h" #include "client/pango.h" #include "client/window.h" -#include "bar/config.h" -#include "bar/status_line.h" -#include "bar/render.h" +#include "swaybar/config.h" +#include "swaybar/status_line.h" +#include "swaybar/render.h" /* internal spacing */ diff --git a/swaybar/status_line.c b/swaybar/status_line.c index 33a8908fc..c7055d4c1 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c @@ -3,9 +3,9 @@ #include #include +#include "swaybar/config.h" +#include "swaybar/status_line.h" #include "log.h" -#include "bar/config.h" -#include "bar/status_line.h" #include "util.h" #define I3JSON_MAXDEPTH 4 diff --git a/swaylock/main.c b/swaylock/main.c index 3049934eb..0637453c5 100644 --- a/swaylock/main.c +++ b/swaylock/main.c @@ -12,13 +12,12 @@ #include #include #include - #include "client/window.h" #include "client/registry.h" #include "client/cairo.h" +#include "swaylock/swaylock.h" #include "ipc-client.h" #include "log.h" -#include "lock/lock.h" struct registry *registry; struct render_data render_data; From 38ca94e0ed2fe33ab71076680e9f70409a2e4115 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Sep 2016 08:34:52 -0400 Subject: [PATCH 4/5] Tweak how swaylock surfaces are handled Fixes #875 --- sway/extensions.c | 14 ++++---------- sway/focus.c | 15 +++++++-------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/sway/extensions.c b/sway/extensions.c index 70ec537d2..60cd8d41c 100644 --- a/sway/extensions.c +++ b/sway/extensions.c @@ -119,27 +119,21 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou if (!swayc_is_child_of(view, workspace)) { move_container_to(view, workspace); } - // make the view floating so it doesn't rearrange other - // siblings. + // make the view floating so it doesn't rearrange other siblings. if (!view->is_floating) { - // Remove view from its current location destroy_container(remove_child(view)); - // and move it into workspace floating add_floating(workspace, view); } wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); - workspace->fullscreen = view; - ipc_event_window(view, "fullscreen_mode"); + wlc_view_bring_to_front(view->handle); + wlc_view_focus(view->handle); desktop_shell.is_locked = true; - // reset input state input_init(); - // set focus if the lockscreen is spawned on the currently - // active output + arrange_windows(workspace, -1, -1); swayc_t *focus_output = swayc_active_output(); if (focus_output == output) { set_focused_container(view); } - arrange_windows(workspace, -1, -1); list_add(desktop_shell.lock_surfaces, surface); wl_resource_set_destructor(surface, lock_surface_destructor); } else { diff --git a/sway/focus.c b/sway/focus.c index 9207260dc..02e61ac28 100644 --- a/sway/focus.c +++ b/sway/focus.c @@ -3,6 +3,7 @@ #include "sway/workspace.h" #include "sway/layout.h" #include "sway/config.h" +#include "sway/extensions.h" #include "sway/input_state.h" #include "sway/ipc-server.h" #include "sway/border.h" @@ -88,7 +89,6 @@ swayc_t *get_focused_container(swayc_t *parent) { if (!parent) { return swayc_active_workspace(); } - // get focused container while (!parent->is_focused && parent->focused) { parent = parent->focused; } @@ -132,24 +132,24 @@ bool set_focused_container(swayc_t *c) { p->is_focused = false; } - // get new focused view and set focus to it. if (!(wlc_view_get_type(p->handle) & WLC_BIT_POPUP)) { - // unactivate previous focus if (focused->type == C_VIEW) { wlc_view_set_state(focused->handle, WLC_BIT_ACTIVATED, false); } update_container_border(focused); - // activate current focus if (c->type == C_VIEW) { wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true); } - // set focus - wlc_view_focus(c->handle); + if (!desktop_shell.is_locked) { + // If the system is locked, we do everything _but_ actually setting + // focus. This includes making our internals think that this view is + // focused. + wlc_view_focus(c->handle); + } if (c->parent->layout != L_TABBED && c->parent->layout != L_STACKED) { update_container_border(c); } - // rearrange if parent container is tabbed/stacked swayc_t *parent = swayc_tabbed_stacked_ancestor(c); if (parent != NULL) { arrange_backgrounds(); @@ -174,7 +174,6 @@ bool set_focused_container_for(swayc_t *a, swayc_t *c) { return false; } swayc_t *find = c; - // Ensure that a is an ancestor of c while (find != a && (find = find->parent)) { if (find == &root_container) { return false; From 6addaca9fafbc20a0fa52f630e1002d6d9240b8f Mon Sep 17 00:00:00 2001 From: Lukas Lihotzki Date: Fri, 2 Sep 2016 00:46:36 +0200 Subject: [PATCH 5/5] Correct `hide_edge_borders` command `vertical` and `horizontal` should be swapped. If border_left and border_right were set to 0, the vertical borders instead of the horizontal borders would be hidden. i3 handles this command equally. --- sway/layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sway/layout.c b/sway/layout.c index cf6a111e8..7f053d9b4 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -575,7 +575,7 @@ void update_geometry(swayc_t *container) { // handle hide_edge_borders if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && workspace->children->length == 1))) { - if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) { + if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) { if (geometry.origin.x == workspace->x) { border_left = 0; } @@ -585,7 +585,7 @@ void update_geometry(swayc_t *container) { } } - if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) { + if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) { if (geometry.origin.y == workspace->y || should_hide_top_border(container, geometry.origin.y)) { border_top = 0; }