/**
* Move the given workspace to the specified output.
- * This returns true if and only if moving the workspace was successful.
*
*/
-bool workspace_move_to_output(Con *ws, Output *output);
+void workspace_move_to_output(Con *ws, Output *output);
}
Output *current_output = get_output_for_con(ws);
- if (current_output == NULL) {
- yerror("Cannot get current output. This is a bug in i3.");
- return;
- }
-
Output *target_output = get_output_from_string(current_output, name);
if (!target_output) {
yerror("Could not get output from string \"%s\"", name);
return;
}
- bool success = workspace_move_to_output(ws, target_output);
- if (!success) {
- yerror("Failed to move workspace to output.");
- return;
- }
+ workspace_move_to_output(ws, target_output);
}
cmd_output->needs_tree_render = true;
*/
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);
Output *get_output_for_con(Con *con) {
Con *output_con = con_get_output(con);
- if (output_con == NULL) {
- ELOG("Could not get the output container for con = %p.\n", con);
- return NULL;
- }
-
Output *output = get_output_by_name(output_con->name, true);
- if (output == NULL) {
- ELOG("Could not get output from name \"%s\".\n", output_con->name);
- return NULL;
- }
+ assert(output != NULL);
return output;
}
/*
* Move the given workspace to the specified output.
- * This returns true if and only if moving the workspace was successful.
*/
-bool workspace_move_to_output(Con *ws, Output *output) {
+void workspace_move_to_output(Con *ws, Output *output) {
DLOG("Moving workspace %p / %s to output %p / \"%s\".\n", ws, ws->name, output, output_primary_name(output));
Output *current_output = get_output_for_con(ws);
- if (current_output == NULL) {
- ELOG("Cannot get current output. This is a bug in i3.\n");
- return false;
- }
-
Con *content = output_get_content(output->con);
DLOG("got output %p with content %p\n", output, content);
}
if (!previously_visible_ws) {
- return true;
+ return;
}
/* NB: We cannot simply work with previously_visible_ws since it might have
CALL(previously_visible_ws, on_remove_child);
break;
}
-
- return true;
}