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

Added keyboard shortcuts to focus a specific window in a current workspace (#195) #662

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mkasprz
Copy link

@mkasprz mkasprz commented May 16, 2021

The hotkeys just make possible to focus a specific window in a current workspace and I've aimed to make them basically work in the same manner as the ones for changing a workspace.

I've set them hotkeys to Ctrl + Super + <N> by default to avoid some collision, even though I personally use Super + <N> and changed the ones to switch workspace to Super + F<N>.

Moving the window to a specific index is not implemented yet. I believe it could be done within another Issue or at least in a different Merge Request.

this.connectTileableFocusChange();
}
);
const workspaceAdditionConnectionId = this.workspaceManager.connect(
Copy link
Author

Choose a reason for hiding this comment

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

I havent't figured out any other way to determine that the extension is loaded and Me.msWorkspaceManager.getActiveMsWorkspace() doesn't return undefined. I tried using this.workspaceManager.get_active_workspace().connect('tileable-focus-changed'(...)), but it only made the extension crash I believe.

this.lastStash = null;
this.nextStash = null;
connectTileableFocusChange() {
this.tilableFocusChangeConnectionId = Me.msWorkspaceManager
Copy link
Author

@mkasprz mkasprz May 16, 2021

Choose a reason for hiding this comment

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

I probably could connect to 'focus-changed' event from Me.msWindowManager.msFocusManager instead, which could made the code simpler I believe, but this event is not emitted for the "MsApplicationLauncher" (last tileable - "+") and tileable-focus-changed is. Is it a bug?

connectId: number;
lastStash: number | null;
nextStash: number | null;
lastWorkspaceIndex: number | null;
Copy link
Author

Choose a reason for hiding this comment

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

I renamed the variables to distinct them from the once I added.

@mkasprz mkasprz marked this pull request as ready for review May 16, 2021 18:57
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.

None yet

1 participant