diff --git a/include/workspace.h b/include/workspace.h index db544ce8..69974a2e 100644 --- a/include/workspace.h +++ b/include/workspace.h @@ -218,7 +218,6 @@ Con *workspace_encapsulate(Con *ws); /** * 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); diff --git a/src/commands.c b/src/commands.c index 778b4a1a..b7fbce90 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1114,22 +1114,13 @@ void cmd_move_workspace_to_output(I3_CMD, const char *name) { } 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; diff --git a/src/con.c b/src/con.c index f904bfe8..a88909e1 100644 --- a/src/con.c +++ b/src/con.c @@ -1400,8 +1400,6 @@ void con_move_to_output(Con *con, Output *output, bool fix_coordinates) { */ 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); diff --git a/src/output.c b/src/output.c index ebba5c77..3d931b1b 100644 --- a/src/output.c +++ b/src/output.c @@ -54,16 +54,8 @@ char *output_primary_name(Output *output) { 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; } diff --git a/src/workspace.c b/src/workspace.c index b36885ee..0aeecb45 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -961,17 +961,11 @@ Con *workspace_encapsulate(Con *ws) { /* * 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); @@ -1039,7 +1033,7 @@ bool workspace_move_to_output(Con *ws, Output *output) { } if (!previously_visible_ws) { - return true; + return; } /* NB: We cannot simply work with previously_visible_ws since it might have @@ -1058,6 +1052,4 @@ bool workspace_move_to_output(Con *ws, Output *output) { CALL(previously_visible_ws, on_remove_child); break; } - - return true; }