Added keyboard shortcuts to focus a specific window in a current workspace (#195) by mkasprz · Pull Request #662 · material-shell/material-shell · GitHub
Skip to content

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

Open
mkasprz wants to merge 4 commits into
material-shell:mainfrom
mkasprz:#195
Open

Added keyboard shortcuts to focus a specific window in a current workspace (#195)#662
mkasprz wants to merge 4 commits into
material-shell:mainfrom
mkasprz:#195

Conversation

@mkasprz

@mkasprz mkasprz commented May 16, 2021

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
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

@mkasprz mkasprz May 16, 2021

Copy link
Copy Markdown
Author

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?

Comment thread src/module/hotKeysModule.ts Outdated

Copy link
Copy Markdown
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.

1 participant