~minos-archive/minos/i3

« back to all changes in this revision

Viewing changes to src/randr.c

  • Committer: Javier Lopez
  • Date: 2020-12-31 05:00:06 UTC
  • Revision ID: git-v1:70bdcadbb7e84dcdd978482eaed91e67b0c847a7
automatic sync 31-12-2020:00:00

Show diffs side-by-side

added added

removed removed

Lines of Context:
439
439
    Con *previous_focus = con_get_workspace(focused);
440
440
 
441
441
    /* Iterate over all workspaces and check if any of them should be assigned
442
 
     * to this output. */
443
 
    Con *output_con;
444
 
    TAILQ_FOREACH (output_con, &(croot->nodes_head), nodes) {
445
 
        if (con_is_internal(output_con)) {
446
 
            continue;
447
 
        }
448
 
 
449
 
        Con *workspace;
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) {
453
 
                continue;
454
 
            }
455
 
 
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);
463
 
        }
 
442
     * to this 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. */
 
446
    Con *workspace;
 
447
    TAILQ_FOREACH (workspace, &all_cons, all_cons) {
 
448
        if (workspace->type != CT_WORKSPACE || con_is_internal(workspace)) {
 
449
            continue;
 
450
        }
 
451
 
 
452
        Con *workspace_out = get_assigned_output(workspace->name, workspace->num);
 
453
 
 
454
        if (output->con != workspace_out) {
 
455
            continue;
 
456
        }
 
457
 
 
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));
 
461
 
 
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);
464
467
    }
465
468
 
466
469
    /* Temporarily set the focused container, might not be initialized yet. */