match_parse_property(current_match, ctype, cvalue);
}
+static void move_matches_to_workspace(Con *ws) {
+ owindow *current;
+ TAILQ_FOREACH(current, &owindows, owindows) {
+ DLOG("matching: %p / %s\n", current->con, current->con->name);
+ con_move_to_workspace(current->con, ws, true, false, false);
+ }
+}
+
/*
* Implementation of 'move [window|container] [to] workspace
* next|prev|next_on_output|prev_on_output|current'.
*
*/
void cmd_move_con_to_workspace(I3_CMD, const char *which) {
- owindow *current;
-
DLOG("which=%s\n", which);
/* We have nothing to move:
return;
}
- TAILQ_FOREACH(current, &owindows, owindows) {
- DLOG("matching: %p / %s\n", current->con, current->con->name);
- con_move_to_workspace(current->con, ws, true, false, false);
- }
+ move_matches_to_workspace(ws);
cmd_output->needs_tree_render = true;
// XXX: default reply for now, make this a better reply
*
*/
void cmd_move_con_to_workspace_back_and_forth(I3_CMD) {
- owindow *current;
- Con *ws;
-
- ws = workspace_back_and_forth_get();
-
+ Con *ws = workspace_back_and_forth_get();
if (ws == NULL) {
yerror("No workspace was previously active.");
return;
HANDLE_EMPTY_MATCH;
- TAILQ_FOREACH(current, &owindows, owindows) {
- DLOG("matching: %p / %s\n", current->con, current->con->name);
- con_move_to_workspace(current->con, ws, true, false, false);
- }
+ move_matches_to_workspace(ws);
cmd_output->needs_tree_render = true;
// XXX: default reply for now, make this a better reply
}
const bool no_auto_back_and_forth = (_no_auto_back_and_forth != NULL);
- owindow *current;
/* We have nothing to move:
* when criteria was specified but didn't match any window or
HANDLE_EMPTY_MATCH;
- TAILQ_FOREACH(current, &owindows, owindows) {
- DLOG("matching: %p / %s\n", current->con, current->con->name);
- con_move_to_workspace(current->con, ws, true, false, false);
- }
+ move_matches_to_workspace(ws);
cmd_output->needs_tree_render = true;
// XXX: default reply for now, make this a better reply
*/
void cmd_move_con_to_workspace_number(I3_CMD, const char *which, const char *_no_auto_back_and_forth) {
const bool no_auto_back_and_forth = (_no_auto_back_and_forth != NULL);
- owindow *current;
/* We have nothing to move:
* when criteria was specified but didn't match any window or
HANDLE_EMPTY_MATCH;
- TAILQ_FOREACH(current, &owindows, owindows) {
- DLOG("matching: %p / %s\n", current->con, current->con->name);
- con_move_to_workspace(current->con, workspace, true, false, false);
- }
+ move_matches_to_workspace(workspace);
cmd_output->needs_tree_render = true;
// XXX: default reply for now, make this a better reply