mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 07:52:03 +00:00
remove friends focus workaround
This commit is contained in:
@@ -4,9 +4,6 @@ import {
|
|||||||
Patch,
|
Patch,
|
||||||
QuickAccessTab,
|
QuickAccessTab,
|
||||||
Router,
|
Router,
|
||||||
callOriginal,
|
|
||||||
findModuleChild,
|
|
||||||
replacePatch,
|
|
||||||
showModal,
|
showModal,
|
||||||
sleep,
|
sleep,
|
||||||
staticClasses,
|
staticClasses,
|
||||||
@@ -97,38 +94,6 @@ class PluginLoader extends Logger {
|
|||||||
initFilepickerPatches();
|
initFilepickerPatches();
|
||||||
|
|
||||||
this.updateVersion();
|
this.updateVersion();
|
||||||
|
|
||||||
const self = this;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// TODO remove all of this once Valve fixes the bug
|
|
||||||
const focusManager = findModuleChild((m) => {
|
|
||||||
if (typeof m !== 'object') return false;
|
|
||||||
for (let prop in m) {
|
|
||||||
if (m[prop]?.prototype?.TakeFocus) return m[prop];
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.focusWorkaroundPatch = replacePatch(focusManager.prototype, 'TakeFocus', function () {
|
|
||||||
// @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;
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
this.error('Friends focus patch failed', e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateVersion() {
|
public async updateVersion() {
|
||||||
|
|||||||
Reference in New Issue
Block a user