aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-01-22 03:47:32 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-22 13:13:34 +0100
commit8ce57f0a77f50315c83bae305e78091cc40175c2 (patch)
tree1d279b36e7c3a16defd1e3ec4be2335f0eb0982f
parentutil.c: remove numlen function (diff)
downloadsway-8ce57f0a77f50315c83bae305e78091cc40175c2.tar.gz
sway-8ce57f0a77f50315c83bae305e78091cc40175c2.tar.zst
sway-8ce57f0a77f50315c83bae305e78091cc40175c2.zip
root_scratchpad_remove_container: do not show
This removes the call to `root_scratchpad_show` from `root_scratchpad_remove_container` and places it in the `cmd_move_container`. This also moved the IPC `window::move` event to `cmd_scratchpad`.
-rw-r--r--sway/commands/move.c1
-rw-r--r--sway/commands/scratchpad.c4
-rw-r--r--sway/tree/root.c7
3 files changed, 5 insertions, 7 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index b22bb056..acb5f44f 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -515,6 +515,7 @@ static struct cmd_results *cmd_move_container(int argc, char **argv) {
515 // move container 515 // move container
516 if (container->scratchpad) { 516 if (container->scratchpad) {
517 root_scratchpad_remove_container(container); 517 root_scratchpad_remove_container(container);
518 root_scratchpad_show(container);
518 } 519 }
519 switch (destination->type) { 520 switch (destination->type) {
520 case N_WORKSPACE: 521 case N_WORKSPACE:
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c
index 805dbc0b..714efa2b 100644
--- a/sway/commands/scratchpad.c
+++ b/sway/commands/scratchpad.c
@@ -3,6 +3,7 @@
3#include "sway/config.h" 3#include "sway/config.h"
4#include "sway/input/input-manager.h" 4#include "sway/input/input-manager.h"
5#include "sway/input/seat.h" 5#include "sway/input/seat.h"
6#include "sway/ipc-server.h"
6#include "sway/tree/container.h" 7#include "sway/tree/container.h"
7#include "sway/tree/root.h" 8#include "sway/tree/root.h"
8#include "sway/tree/workspace.h" 9#include "sway/tree/workspace.h"
@@ -51,6 +52,7 @@ static void scratchpad_toggle_auto(void) {
51 "Moving a visible scratchpad window (%s) to this workspace", 52 "Moving a visible scratchpad window (%s) to this workspace",
52 con->title); 53 con->title);
53 root_scratchpad_show(con); 54 root_scratchpad_show(con);
55 ipc_event_window(con, "move");
54 return; 56 return;
55 } 57 }
56 } 58 }
@@ -62,6 +64,7 @@ static void scratchpad_toggle_auto(void) {
62 struct sway_container *con = root->scratchpad->items[0]; 64 struct sway_container *con = root->scratchpad->items[0];
63 sway_log(SWAY_DEBUG, "Showing %s from list", con->title); 65 sway_log(SWAY_DEBUG, "Showing %s from list", con->title);
64 root_scratchpad_show(con); 66 root_scratchpad_show(con);
67 ipc_event_window(con, "move");
65} 68}
66 69
67static void scratchpad_toggle_container(struct sway_container *con) { 70static void scratchpad_toggle_container(struct sway_container *con) {
@@ -76,6 +79,7 @@ static void scratchpad_toggle_container(struct sway_container *con) {
76 } 79 }
77 80
78 root_scratchpad_show(con); 81 root_scratchpad_show(con);
82 ipc_event_window(con, "move");
79} 83}
80 84
81struct cmd_results *cmd_scratchpad(int argc, char **argv) { 85struct cmd_results *cmd_scratchpad(int argc, char **argv) {
diff --git a/sway/tree/root.c b/sway/tree/root.c
index ec6bccf6..c4d1145d 100644
--- a/sway/tree/root.c
+++ b/sway/tree/root.c
@@ -85,9 +85,6 @@ void root_scratchpad_remove_container(struct sway_container *con) {
85 if (!sway_assert(con->scratchpad, "Container is not in scratchpad")) { 85 if (!sway_assert(con->scratchpad, "Container is not in scratchpad")) {
86 return; 86 return;
87 } 87 }
88 if (!con->workspace) {
89 root_scratchpad_show(con);
90 }
91 con->scratchpad = false; 88 con->scratchpad = false;
92 int index = list_find(root->scratchpad, con); 89 int index = list_find(root->scratchpad, con);
93 if (index != -1) { 90 if (index != -1) {
@@ -133,10 +130,6 @@ void root_scratchpad_show(struct sway_container *con) {
133 130
134 arrange_workspace(new_ws); 131 arrange_workspace(new_ws);
135 seat_set_focus(seat, seat_get_focus_inactive(seat, &con->node)); 132 seat_set_focus(seat, seat_get_focus_inactive(seat, &con->node));
136
137 if (new_ws != old_ws) {
138 ipc_event_window(con, "move");
139 }
140} 133}
141 134
142void root_scratchpad_hide(struct sway_container *con) { 135void root_scratchpad_hide(struct sway_container *con) {