Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree: focus float nodes when switching workspaces #335

Merged

Conversation

tadeokondrak
Copy link
Contributor

Right now if a workspace only contains a floating node, switching to that workspace will not change the currently focused window (without focus-follows-mouse doing its thing)

src/tree/workspace.rs Outdated Show resolved Hide resolved
src/tree/workspace.rs Outdated Show resolved Hide resolved
@mahkoh
Copy link
Owner

mahkoh commented Dec 27, 2024

This looks good in general.

@tadeokondrak tadeokondrak force-pushed the workspace-switch-focus-float-node branch from a81e2d6 to e1bbbb4 Compare December 27, 2024 19:48
@tadeokondrak
Copy link
Contributor Author

One thing I'm not sure about is if floating containers should be prioritized over tiling ones. Currently it's the floating containers but that feels motivated by the fact that there doesn't yet seem to be a way to focus them with the keyboard.

@mahkoh
Copy link
Owner

mahkoh commented Dec 27, 2024

I had only reviewed from my phone so far and hadn't caught that your change prioritizes floating windows over tiled ones. I'd prefer to only focus floating windows if all of the existing logic fails. As you say, the inability to navigate such windows with the keyboard alone exists independently workspace focus behavior.

src/tree/workspace.rs Outdated Show resolved Hide resolved
@tadeokondrak tadeokondrak force-pushed the workspace-switch-focus-float-node branch from e1bbbb4 to 834eedc Compare January 3, 2025 19:01
@tadeokondrak
Copy link
Contributor Author

I'd prefer to only focus floating windows if all of the existing logic fails

Sounds good, updated

} else if let Some(float) = self
.stacked
.rev_iter()
.find_map(|node| (*node).clone().node_into_float())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clone can be avoided but it doesn't allocate so I don't think it makes much of a difference

@mahkoh mahkoh merged commit 9ab94be into mahkoh:master Jan 6, 2025
5 checks passed
@mahkoh
Copy link
Owner

mahkoh commented Jan 6, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants