Skip to content

Improve focus history handling. #898

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

Merged
merged 3 commits into from
Feb 16, 2023
Merged

Improve focus history handling. #898

merged 3 commits into from
Feb 16, 2023

Conversation

HalfVoxel
Copy link
Contributor

@HalfVoxel HalfVoxel commented Oct 7, 2022

Previously, when moving a window from e.g. workspace 1 to workspace 3 by moving it down twice, workspace 2 would end up with the wrong focused window. This was because the window was first moved there (receiving focus), and then removed from that workspace (setting the focus to an adjacent window). However, I could have had any window focused before.

With these changes, the focus will be preserved for in-between workspaces when moving windows.

More generally, when closing a window, it will try to focus the previously closed window instead of just the adjacent ones. The split layout is a special case that still always uses the adjacent windows. Previously this was done sometimes, but not consistently, by using the insertedMsWindow and precedentIndex fields. But they didn't always work, or they contained bad info. The new approach is more robust.

I've also fixed a few bugs that could lead to the task bar tabs getting incorrect states.
image
In the above screenshot, the launcher tab is highlighted as active, even though Alacritty is the focused application.
or
image
In the above screenshot, the application launcher is active, but the task bar says Alacritty should be active.

Tested on Gnome 42.4

@HalfVoxel HalfVoxel requested a review from PapyElGringo October 7, 2022 11:36
Copy link
Collaborator

@PapyElGringo PapyElGringo left a comment

Choose a reason for hiding this comment

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

This PR does fix the Focus behavior when moving Window across workspaces but also change the behavior of closing apps which now differ from what we used to in all Web Browser.

@HalfVoxel HalfVoxel force-pushed the aron/improve_focus_history branch from e87c9d8 to 0c9d3d6 Compare February 16, 2023 14:15
@HalfVoxel HalfVoxel merged commit b261bfa into main Feb 16, 2023
@HalfVoxel HalfVoxel deleted the aron/improve_focus_history branch February 16, 2023 14:17
@rizajur
Copy link

rizajur commented Feb 17, 2023

@HalfVoxel XMR address ? - in case use privatebin if you wish

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.

3 participants