Skip to content

Repository files navigation

Elevator Pitch

Problem

Xbox Mode forces every app into full screen mode and seems to suspend processes that the desktop experience relies on. Alt-tabbing out of a game to use Discord while in Xbox Mode results in flickering and apps becoming unresponsive. On top of that, on an ultrawide display like mine apps get really stretched out in full screen mode.

Additionally, having to switch to my mouse to control Discord kind of brokr the "use your PC as an Xbox" experience for me. It's like that same itch a programmer has to use the keyboard for everything - having to switch from the controller to the mouse, alt-tabbing, floating around the UI with my mouse for a few seconds until I get my bearings, etc... I just wanna game, and it wastes time

Solution

This widget adds basic Discord control to the Xbox Game Bar, which includes:

  • Mute / unmute
  • Deafen
  • Leave / Switch channels

Since this hooks into the game bar, navigating with a controller works great. This widget lets you stay in your game / xbox mode so you don't have to put the controller down.

Security

This app runs completely locally on your computer and requires the Discord desktop app in order to work. Communication with the Discord app is done via Remote Procedure Calls (RPC) between the widget and the Discord app using a bridge process. The bridge process is needed because when UWP apps use named pipes, it is under a different set of privileges due to the way UWP containerizes apps. The widget uses an app service connection in full trust mode to the bridge, and the bridge makes the RPCs on our behalf using the named pipe just as any other desktop app would. My testing across gaming sessions showed zero input latency between the widget and the discord app. Only the widget can talk to the bridge, and vice verse. For more technical details, see the docs

Disclaimer

Much of the text (aka everything outside of this elevator pitch section) and code in this repository was written by Anthropic's Claude Code, using Fable 5 during the ideation and high-level feasibility research portion, and Opus 5 during actual implementation. I started this idea out of frustration on a gaming night, and as such didn't want to spend a lot of time writing code. I did learn a ton about RPC, named pipes, and UWP. (still not a huge fan of it, but this learning experience made me appreciate it a bit more. Win32 FTW though!) All code has been reviewed, tested, and signed off by me. Claude, take it away!

- Terry Ellison


DiscordXboxWidget

Discord voice controls inside the Xbox Game Bar. See who's in your channel, who's talking, mute and deafen yourself, and hop between channels directly from the Game Bar. Controllers are fully supported, so no more awkwardly switching between controller and mouse or Alt tabbing.

The widget open in Game Bar, showing a voice channel with participants and a speaking indicator

What it does

  • Live participant list with avatars, server nicknames, and mute/deafen state
  • Speaking indicator — a ring lights around whoever is talking
  • Mute and deafen yourself without switching windows
  • Channel switching — browse your servers and jump to another voice channel

The channel picker showing the server list

Requirements

  • Windows 10 1903 (build 18362) or later
  • The Discord desktop client running (the web app does not expose the local RPC socket)

Install

1. Trust the signing certificate

Releases are signed with a self-signed certificate, so Windows needs to be told to trust it before it will install the package. Download DiscordXboxWidget.cer from the latest release and, in an elevated PowerShell:

Import-Certificate -FilePath .\DiscordXboxWidget.cer -CertStoreLocation Cert:\LocalMachine\TrustedPeople

This project cannot be distributed through the Microsoft Store (see Distribution), so there is no CA-issued signature to fall back on. Inspect the certificate first if you would rather not take that on trust.

2. Install the package

Download every file attached to the release into the same folder, then:

Add-AppxPackage -Path .\DiscordXboxWidget_0.1.3.0_x64.msix -DependencyPath .\Microsoft.NET.Native.Framework.2.2.appx,.\Microsoft.NET.Native.Runtime.2.2.appx,.\Microsoft.VCLibs.x64.14.00.appx

The framework packages matter: Windows cannot fetch them from the Store for a sideloaded app, and without them the install fails with 0x80073CF3. If your machine already has them, the extra arguments are harmless.

The package is around 43 MB because it carries its own .NET runtime. That is deliberate: nothing about a sideloaded install can fetch a missing shared runtime, so the alternative was a prerequisite you would discover by the widget not working.

3. Register a Discord application

A two-minute, one-time step. No application ID is shipped with the widget — Discord's Developer Terms classify it as a developer credential and forbid embedding those in open source projects. The upside is that you grant permissions to an application you own rather than to someone else's.

  1. Go to the Discord Developer Portal and click New Application
  2. Open the OAuth2 tab
  3. Enable Public Client
  4. Add http://localhost under Redirects and save
  5. Copy the Application ID

Keeping the application under your own ownership is simplest — Discord grants an owner access to their own application automatically. If you put it in a Team, that stops: team-owned applications grant nobody access implicitly, and you must add yourself under App Testers or authorization fails with invalid_scope.

The OAuth2 tab with Public Client enabled and the localhost redirect added

4. Point the widget at it

Press Win+G, open the widget menu, and pick Discord Voice.

The Game Bar widget menu with Discord Voice listed

On first launch it will say no application is configured. Click the gear in the widget's title bar, paste your Application ID, and press Save and connect.

Discord then shows a consent dialog asking you to authorize your application. Accept it once; the token is cached DPAPI-encrypted, so the prompt will not reappear.

The refresh button beside the controls reconnects at any time — useful if you started the widget before Discord, or changed applications.

Editing the file directly instead

The same setting lives in %LOCALAPPDATA%\DiscordXboxWidget\config.json, written as a template on first launch:

{
  "clientId": "123456789012345678"
}

Press refresh in the widget afterwards, or reopen it, so the bridge picks up the change.

If something goes wrong

The widget shows the reason in place of the channel name. Two logs carry the detail:

type "$env:LOCALAPPDATA\DiscordXboxWidget\bridge.log"
Get-ChildItem "$env:LOCALAPPDATA\Packages\DiscordXboxWidget_*\LocalState\widget.log"
Symptom Cause
0x80073CFB on install A build deployed from Visual Studio is registered. Remove-AppxPackage it first — an unpackaged registration cannot be replaced by a packaged one
"No Discord application configured" Step 4 — set the Application ID via the gear
invalid_client during authorization Public Client not enabled on your app's OAuth2 tab
invalid_scope during authorization The application is in a Team and your account is not under App Testers. Team-owned apps grant no implicit access, even to their own team
4006 / not authorized The Discord account in use does not own the application from step 3
Widget missing from the Win+G menu Package not installed, or Game Bar needs restarting
Empty participant list Discord desktop client is not running
Stuck on "Connecting" The bridge did not start; check bridge.log

Scope

Voice only — participants, speaking, mute/deafen, channel switching. No text chat, screen share, or push-to-talk. See the roadmap for what that leaves and why.

How it works, briefly

A Game Bar widget runs in an AppContainer, which cannot reach Discord's local RPC socket. So the package ships a small full-trust process that does the RPC and talks to the widget over AppServiceConnection.

That is a more roundabout design than it looks like it should be, for reasons worth reading if you are building anything similar: Architecture.

Documentation

Architecture How the pieces fit, and why the bridge exists
Development Building, tests, the Discord harness, CI/CD, signing
Game Bar notes Platform traps, several contradicting Microsoft's docs
Roadmap Known gaps and what is deliberately not planned
Privacy policy What the app touches — it all stays on your PC
Terms of service Licence, no warranty, no affiliation with Discord or Microsoft

Contributing

Issues and pull requests welcome. Development covers the build, and the harness lets you talk to Discord without going near Game Bar — usually the fastest way to check whether a problem is yours or Discord's.

Licence

See LICENSE.

About

Discord voice controls inside the Xbox Game Bar

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages