8000 Added keyboard shortcuts to focus a specific window in a current workspace (#195) by mkasprz · Pull Request #662 · material-shell/material-shell · GitHub
[go: up one dir, main page]

Skip to content

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

Open
mkasprz wants to merge 4 commits intomaterial-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 intomaterial-shell:mainfrom
mkasprz:#195

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.

1 participant

0