mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 22:31:59 +00:00
actually fix focus issue on startup
This commit is contained in:
@@ -46,15 +46,27 @@ class Toaster extends Logger {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'BFocusWithin', function () {
|
const overrideFocus = function () {
|
||||||
// @ts-ignore
|
// @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');
|
self.debug('Intercepted friends re-focus');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return callOriginal;
|
return callOriginal;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'TakeFocus', overrideFocus);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
instance = findInReactTree(
|
instance = findInReactTree(
|
||||||
(document.getElementById('root') as any)._reactRootContainer._internalRoot.current,
|
(document.getElementById('root') as any)._reactRootContainer._internalRoot.current,
|
||||||
|
|||||||
Reference in New Issue
Block a user