When switching workspaces, the focus is changing to the top window in the not-focused monitor. This is annoying, and makes me type in the wrong window all the time. I think a better (and expected) behavior would be for the focus to change to the top window in the focused monitor.
I tried to ajust the extension and added the following function to class WindowWrapper:
I also added this function in WorkSpacesService, and called it from onWorkspaceChanged():
focusWindowOnActiveMonitor() {
let focusedMonitorIndex = this.getFocusedMonitor();
let wrappers = this._getWindowWrappers();
let windowsOnFocusedMonitor = wrappers
.filter((it) => it.isNormal())
.filter((it) => it.initialMonitorIndex === focusedMonitorIndex);
let topWindow = windowsOnFocusedMonitor.pop();
if (topWindow) {
topWindow.focus();
}
}
It's a simple code and should have worked, making the focus behave nicer...
But as soon as focus() is called, it undoes the _moveToDirection() changes.
I don't know why this happens, maybe I am missing something simple.
When switching workspaces, the focus is changing to the top window in the not-focused monitor. This is annoying, and makes me type in the wrong window all the time. I think a better (and expected) behavior would be for the focus to change to the top window in the focused monitor.
I tried to ajust the extension and added the following function to class WindowWrapper:
I also added this function in WorkSpacesService, and called it from onWorkspaceChanged():
It's a simple code and should have worked, making the focus behave nicer... But as soon as focus() is called, it undoes the _moveToDirection() changes. I don't know why this happens, maybe I am missing something simple.