439
439
Con *previous_focus = con_get_workspace(focused);
441
441
/* Iterate over all workspaces and check if any of them should be assigned
444
TAILQ_FOREACH (output_con, &(croot->nodes_head), nodes) {
445
if (con_is_internal(output_con)) {
450
TAILQ_FOREACH (workspace, &(output_get_content(output_con)->nodes_head), nodes) {
451
Con *workspace_out = get_assigned_output(workspace->name, workspace->num);
452
if (output->con != workspace_out) {
456
DLOG("Moving workspace \"%s\" from output \"%s\" to \"%s\" due to assignment\n",
457
workspace->name, workspace_out->name, output_primary_name(output));
458
/* Need to copy output's rect since content is not yet rendered. We
459
* can't call render_con here because render_output only proceeds
460
* if a workspace exists. */
461
content->rect = output->con->rect;
462
workspace_move_to_output(workspace, output);
443
* Note: in order to do that we iterate over all_cons and not using another
444
* list that would be updated during iteration by the
445
* workspace_move_to_output function. */
447
TAILQ_FOREACH (workspace, &all_cons, all_cons) {
448
if (workspace->type != CT_WORKSPACE || con_is_internal(workspace)) {
452
Con *workspace_out = get_assigned_output(workspace->name, workspace->num);
454
if (output->con != workspace_out) {
458
DLOG("Moving workspace \"%s\" from output \"%s\" to \"%s\" due to assignment\n",
459
workspace->name, output_primary_name(get_output_for_con(workspace)),
460
output_primary_name(output));
462
/* Need to copy output's rect since content is not yet rendered. We
463
* can't call render_con here because render_output only proceeds
464
* if a workspace exists. */
465
content->rect = output->con->rect;
466
workspace_move_to_output(workspace, output);
466
469
/* Temporarily set the focused container, might not be initialized yet. */