Merge branch 'fix_overview_key_nav_5345' into 'main'

workspace: Fix tab-key nav of windows

Closes #5345

See merge request GNOME/gnome-shell!2591
This commit is contained in:
Nick Evans 2024-06-29 05:26:12 +00:00
commit 560ad5a1df
3 changed files with 18 additions and 10 deletions

View file

@ -1851,8 +1851,10 @@ export class WindowManager {
if (!Main.sessionMode.hasWorkspaces)
return;
if (!workspace.active)
if (!workspace.active) {
workspace.activate(global.get_current_time());
global.stage.set_key_focus(null);
}
}
actionMoveWindow(window, workspace) {

View file

@ -1029,6 +1029,13 @@ class WorkspaceBackground extends Shell.WorkspaceBackground {
}
});
const WorkspaceWindowContainer = GObject.registerClass(
class WorkspaceWindowContainer extends St.Widget {
vfunc_get_focus_chain() {
return this.layout_manager.getFocusChain();
}
});
export const Workspace = GObject.registerClass(
class Workspace extends St.Widget {
/**
@ -1052,13 +1059,9 @@ class Workspace extends St.Widget {
this.add_child(this._background);
// Window previews
this._container = new Clutter.Actor({
reactive: true,
x_expand: true,
y_expand: true,
});
this._container.layout_manager = layoutManager;
this._container = new WorkspaceWindowContainer({layoutManager});
this.add_child(this._container);
global.focus_manager.add_group(this._container);
this.metaWorkspace = metaWorkspace;
@ -1118,8 +1121,8 @@ class Workspace extends St.Widget {
return overviewState > OverviewControls.ControlsState.WINDOW_PICKER;
}
vfunc_get_focus_chain() {
return this._container.layout_manager.getFocusChain();
vfunc_navigate_focus(from, direction) {
return this._container.navigate_focus(from, direction, false);
}
_lookupIndex(metaWindow) {

View file

@ -38,7 +38,6 @@ const WorkspacesViewBase = GObject.registerClass({
y_expand: true,
});
this.connect('destroy', this._onDestroy.bind(this));
global.focus_manager.add_group(this);
this._monitorIndex = monitorIndex;
@ -395,6 +394,10 @@ class WorkspacesView extends WorkspacesViewBase {
return this._workspaces[active];
}
vfunc_navigate_focus(from, direction) {
return this.getActiveWorkspace().navigate_focus(from, direction, false);
}
prepareToLeaveOverview() {
for (let w = 0; w < this._workspaces.length; w++)
this._workspaces[w].prepareToLeaveOverview();