MCPcopy Create free account
hub / github.com/material-shell/material-shell / grab_key_focus

Method grab_key_focus

src/layout/msWorkspace/msWindow.ts:1114–1123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1112 }
1113
1114 grab_key_focus(): void {
1115 // TODO: Seems a bit redundant to first focus the dialogs and then change focus to the main window (is that even desired?)
1116 this.focusDialogs();
1117 if (!Me.msWindowManager!.msFocusManager.requestFocus(this)) return;
1118 if (this.metaWindow) {
1119 this.metaWindow.activate(global.get_current_time());
1120 } else {
1121 this.placeholder.grab_key_focus();
1122 }
1123 }
1124
1125 /**
1126 * Set focus to the most recent dialog but ONLY if they are of type Meta.WindowType.DIALOG or Meta.WindowType.MODAL_DIALOG. Other dialogs are not necessarily in front of the main window and do not necessarily require the users attention.

Callers 1

addDialogMethod · 0.95

Calls 5

focusDialogsMethod · 0.95
requestFocusMethod · 0.80
activateMethod · 0.65
get_current_timeMethod · 0.65
grab_key_focusMethod · 0.65

Tested by

no test coverage detected