* visible workspace on the given output.
*
*/
-void con_move_to_output(Con *con, Output *output);
+void con_move_to_output(Con *con, Output *output, bool fix_coordinates);
+
+/**
+ * Moves the given container to the currently focused container on the
+ * visible workspace on the output specified by the given name.
+ * The current output for the container is used to resolve relative names
+ * such as left, right, up, down.
+ *
+ */
+bool con_move_to_output_name(Con *con, const char *name, bool fix_coordinates);
/**
* Moves the given container to the given mark.
TAILQ_FOREACH(current, &owindows, owindows) {
DLOG("matching: %p / %s\n", current->con, current->con->name);
- Output *current_output = get_output_for_con(current->con);
- assert(current_output != NULL);
-
- Output *output = get_output_from_string(current_output, name);
- if (output == NULL) {
- ELOG("Could not find output \"%s\", skipping.\n", name);
- had_error = true;
- continue;
- }
-
- Con *ws = NULL;
- GREP_FIRST(ws, output_get_content(output->con), workspace_is_visible(child));
- if (ws == NULL) {
- ELOG("Could not find a visible workspace on output %p.\n", output);
- had_error = true;
- continue;
- }
-
- con_move_to_workspace(current->con, ws, true, false, false);
+ had_error |= !con_move_to_output_name(current->con, name, true);
}
cmd_output->needs_tree_render = true;
* visible workspace on the given output.
*
*/
-void con_move_to_output(Con *con, Output *output) {
+void con_move_to_output(Con *con, Output *output, bool fix_coordinates) {
Con *ws = NULL;
GREP_FIRST(ws, output_get_content(output->con), workspace_is_visible(child));
assert(ws != NULL);
DLOG("Moving con %p to output %s\n", con, output_primary_name(output));
- con_move_to_workspace(con, ws, false, false, false);
+ con_move_to_workspace(con, ws, fix_coordinates, false, false);
+}
+
+/*
+ * Moves the given container to the currently focused container on the
+ * visible workspace on the output specified by the given name.
+ * The current output for the container is used to resolve relative names
+ * such as left, right, up, down.
+ *
+ */
+bool con_move_to_output_name(Con *con, const char *name, bool fix_coordinates) {
+ Output *current_output = get_output_for_con(con);
+ assert(current_output != NULL);
+
+ Output *output = get_output_from_string(current_output, name);
+ if (output == NULL) {
+ ELOG("Could not find output \"%s\"\n", name);
+ return false;
+ }
+
+ con_move_to_output(con, output, fix_coordinates);
+ return true;
}
/*
* needed e.g. for LibreOffice Impress multi-monitor
* presentations to work out of the box. */
if (output != NULL)
- con_move_to_output(nc, output);
+ con_move_to_output(nc, output, false);
con_toggle_fullscreen(nc, CF_OUTPUT);
}
fs = NULL;