BetterDiscord icon indicating copy to clipboard operation
BetterDiscord copied to clipboard

Fix addon editor & themes editor losing focus to Discord UI

Open Pharaoh2k opened this issue 4 months ago • 1 comments

When opening the addon editor or theme editor in a floating window, Discord's UI elements continuously steal focus from the editor, making it impossible to edit.

This PR fixes the issue by temporarily limiting focus changes to elements within the floating window while the editor is open. Normal focus behavior is restored when the editor closes.

Tested with multiple addons and themes and confirmed the editor now maintains focus properly.

Pharaoh2k avatar Aug 05 '25 08:08 Pharaoh2k

I noticed that another dev has proposed a surgical Monaco fix for the focus issue. That fix, combined with this one (which is a solid fix, despite the unfortunate biased thumbs down), provide a comprehensive solution. The overhead of keeping both is minimal, and removing the AddonManager fix risks exposing edge cases that are hard to reproduce and debug. It's better to have redundant protection than to discover focus issues in production. And no worries, I am not doing this because I am looking for any cookies, likes or ranks, I have more than enough of those. I truly just want BD to be better for everyone.

Pharaoh2k avatar Aug 15 '25 18:08 Pharaoh2k