Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'vanilla/next' into gaps-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Airblader committed Jan 2, 2021
2 parents 4e11a4e + b638ca5 commit 28dd055
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
2 changes: 2 additions & 0 deletions RELEASE-NOTES-next
Expand Up @@ -13,9 +13,11 @@ strongly encouraged to upgrade.

• i3-nagbar: position on focused monitor by default
• i3-nagbar: add option to position on primary monitor
• alternate focusing tab/stack children-parent containers by clicking on their titlebars

┌────────────────────────────┐
│ Bugfixes │
└────────────────────────────┘

• when initializing new outputs, avoid duplicating workspace numbers
• fix workspaces not moving to assigned output after output becomes available
2 changes: 2 additions & 0 deletions docs/ipc
Expand Up @@ -132,6 +132,8 @@ GET_CONFIG (9)::
Reply to the GET_CONFIG message.
TICK (10)::
Reply to the SEND_TICK message.
SYNC (11)::
Reply to the SYNC message.
GET_BINDING_STATE (12)::
Reply to the GET_BINDING_STATE message.

Expand Down
16 changes: 14 additions & 2 deletions src/click.c
Expand Up @@ -218,8 +218,20 @@ static void route_click(Con *con, xcb_button_press_event_t *event, const bool mo
goto done;
}

/* 2: focus this con. */
con_activate(con);
/* 2: focus this con or one of its children. */
Con *con_to_focus = con;
if (in_stacked && dest == CLICK_DECORATION) {
/* If the container is a tab/stacked container and the click happened
* on a tab, switch to the tab. If the tab contents were already
* focused, focus the tab container itself. If the tab container was
* already focused, cycle back to focusing the tab contents. */
if (was_focused || !con_has_parent(focused, con)) {
while (!TAILQ_EMPTY(&(con_to_focus->focus_head))) {
con_to_focus = TAILQ_FIRST(&(con_to_focus->focus_head));
}
}
}
con_activate(con_to_focus);

/* 3: For floating containers, we also want to raise them on click.
* We will skip handling events on floating cons in fullscreen mode */
Expand Down
37 changes: 20 additions & 17 deletions src/randr.c
Expand Up @@ -439,28 +439,31 @@ void init_ws_for_output(Output *output) {
Con *previous_focus = con_get_workspace(focused);

/* Iterate over all workspaces and check if any of them should be assigned
* to this output. */
Con *output_con;
TAILQ_FOREACH (output_con, &(croot->nodes_head), nodes) {
if (con_is_internal(output_con)) {
* to this output.
* Note: in order to do that we iterate over all_cons and not using another
* list that would be updated during iteration by the
* workspace_move_to_output function. */
Con *workspace;
TAILQ_FOREACH (workspace, &all_cons, all_cons) {
if (workspace->type != CT_WORKSPACE || con_is_internal(workspace)) {
continue;
}

Con *workspace;
TAILQ_FOREACH (workspace, &(output_get_content(output_con)->nodes_head), nodes) {
Con *workspace_out = get_assigned_output(workspace->name, workspace->num);
if (output->con != workspace_out) {
continue;
}
Con *workspace_out = get_assigned_output(workspace->name, workspace->num);

DLOG("Moving workspace \"%s\" from output \"%s\" to \"%s\" due to assignment\n",
workspace->name, workspace_out->name, output_primary_name(output));
/* Need to copy output's rect since content is not yet rendered. We
* can't call render_con here because render_output only proceeds
* if a workspace exists. */
content->rect = output->con->rect;
workspace_move_to_output(workspace, output);
if (output->con != workspace_out) {
continue;
}

DLOG("Moving workspace \"%s\" from output \"%s\" to \"%s\" due to assignment\n",
workspace->name, output_primary_name(get_output_for_con(workspace)),
output_primary_name(output));

/* Need to copy output's rect since content is not yet rendered. We
* can't call render_con here because render_output only proceeds
* if a workspace exists. */
content->rect = output->con->rect;
workspace_move_to_output(workspace, output);
}

/* Temporarily set the focused container, might not be initialized yet. */
Expand Down

0 comments on commit 28dd055

Please sign in to comment.