mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
actually fix focus issue on startup
This commit is contained in:
@@ -46,15 +46,27 @@ class Toaster extends Logger {
|
||||
return false;
|
||||
});
|
||||
|
||||
const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'BFocusWithin', function () {
|
||||
const overrideFocus = function () {
|
||||
// @ts-ignore
|
||||
if (this.m_node?.m_element && this.m_node?.m_element.classList.contains(staticClasses.TabGroupPanel)) {
|
||||
self.debug(this.m_node.m_element);
|
||||
// @ts-ignore
|
||||
const classList = this.m_node?.m_element.classList;
|
||||
if (
|
||||
// @ts-ignore
|
||||
(this.m_node?.m_element && classList.contains(staticClasses.TabGroupPanel)) ||
|
||||
classList.contains('FriendsListTab') ||
|
||||
classList.contains('FriendsTabList') ||
|
||||
classList.contains('FriendsListAndChatsSteamDeck')
|
||||
) {
|
||||
self.debug('Intercepted friends re-focus');
|
||||
return true;
|
||||
}
|
||||
|
||||
return callOriginal;
|
||||
});
|
||||
};
|
||||
|
||||
const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'TakeFocus', overrideFocus);
|
||||
|
||||
while (true) {
|
||||
instance = findInReactTree(
|
||||
(document.getElementById('root') as any)._reactRootContainer._internalRoot.current,
|
||||
|
||||
Reference in New Issue
Block a user