GithubHelp home page GithubHelp logo

microsoft / xboxgamebarsamples Goto Github PK

View Code? Open in Web Editor NEW
145.0 18.0 27.0 4.49 MB

Sample code for Xbox Game Bar Widgets

Home Page: https://developer.microsoft.com/games/products/game-bar/

License: MIT License

xboxgamebarsamples's Introduction

Xbox Game Bar SDK Samples

The Xbox Game Bar software development kit allows you to build widgets for Xbox Game Bar. An Xbox Game Bar widget is a Windows UWP XAML app that has a XAML view rendered into Xbox Game Bar's UI.

Aside from a slightly different app activation and a little "bootstrapping" when the app is activated, an Xbox Game Bar widget is no different than any other UWP XAML app. In fact your UWP XAML app can be a normal app (support foreground activation) and one or more Xbox Game Bar widgets (support Xbox Game Bar widget activation).

When your app is activated, it will know which activation type is happening so it can create the correct corresponding XAML view.

These samples will allow you to discover how to build your own Game Bar widget.

Build Status

Master Branch Build Status

Documentation

All documentation describing the Game Bar SDK, these samples, OS requirements, and setting up your environment can be found on docs.microsoft.com/gaming/game-bar.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

xboxgamebarsamples's People

Contributors

arvermams avatar hamiltonia avatar jmcker avatar lowspeedburt avatar microsoft-github-operations[bot] avatar microsoftopensource avatar totallymonkey avatar vidager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xboxgamebarsamples's Issues

[SDK BUG] Can't have transparent widget while Game Bar is open

Describe the bug
As of the late October update, one can't have a fully transparent widget while the Game Bar is open.

To Reproduce
Launch any widget (WidgetAdvSampleCS for example) and try to make it transparent while the Game Bar is open. You can't do it. RequestedOpacity doesn't change unless you close the Game bar and have the widget pinned.

Expected behavior
If you make the Background property of the page (MainPage.xaml) and the AppManifest's VisualElements.BackgroundColor property equal to "transparent", it should be transparent.

Desktop (please complete the following information):

  • OS version: Windows 10 20H2
  • Game Bar version 5.420.11102.0
  • SDK version: 5.3.200605002

Additional context
This used to work up until the Game Bar update in late October.

[Question] Setting widget position

Is it possible to programmatically set the position of my widget? I wish for my widget to be in a certain position on the screen (the centre).

[Question] Widget settings's guide/documentation for Multi-View Communication or Feature to make it easier

Is your feature request related to a problem? Please describe.
UWP Multi-View Communication, I am trying the second method of this article. I cant seem to make it worked. First method, I am no sure I know how to make it worked.
Remaining option is static variable in App.xaml, which would be the last thing I would do, except redux store of course.

Describe the solution you'd like
My use case could be automatic update the widget1, while Widget Settings changed. For example, manually change the custom user-configurable option in setting widget then the widget1(note) can automatic change formatting (For example, for text widget or code mode.)

Describe alternatives you've considered
No yet, Knowledge on UWP have no enough to find alternatives for now. To be frankly, I am also not a fan of MVVM. I feel way more trouble to implement reactive and real time feature than Web. But some obstacle and less documentation if the stability and efficiency is the reward.

  1. sender.ActivateSettingsAsync(this);
    able to passing like first method of UWP Multi-View Communication

  2. rootFrame.Navigate(typeof(WidgetSettings), widget2);
    Manually manage windows, Weird and messy, cant use on widget.SettingsClicked += Widget_SettingsClicked;

  3. Use settingsClicked button to show other widget like widget1 as setting widget for widget2. But following might cause exception

private async void Widget_SettingsClicked(XboxGameBarWidget sender, object args){
         widget1 = new XboxGameBarWidget(widgetArgs,Window.Current.CoreWindow,rootFrame);
}

[SDK BUG] SwapChainPanel is not transparent

Describe the bug
<SwapChainPanel x:Name="swapChainPanel"></SwapChainPanel> does not offer transparency while <canvas:CanvasSwapChainPanel x:Name="swapChainPanel" Loaded="CanvasSwapChainPanelLoaded"/> is working fine with transparency.

To Reproduce
Steps to reproduce the behavior:

  1. Create a SwapChainPanel
  2. Init DirectX(11) to/on the SwapChainPanel
  3. Set the clearcolor to float clear_color[4] = { 0.f, 0.f, 0.f, 0.f };
  4. Clear the RenderTarget with the clearcolor pD3dContext->ClearRenderTargetView(pMainRenderTargetView, clear_color);
  5. Get a black window

Expected behavior
Get a transparent window.

Desktop (please complete the following information):

  • OS version: Windows 10 20H2
  • Game Bar version: 5.521.2221.0
  • SDK version: 5.3.200605002

Feature request: Widget Title Bar Navigation Actions

Is your feature request related to a problem? Please describe.
Navigation is a very important thing for composed widgets. This is, a widget cannot interrupt player's gaming experience, and by so, the minimum only necessary elements should be displayed on screen (as the widget, for example, is meant to be used as a pinning). The Game bar SDK does not implements any navigation methods, by itself, the developer should make it work inside the available widget layout.

Describe the solution you'd like
Wouldn't it be nice to have a specific button or other approach to navigation on widgets, available directly by the SDK?
Just like Universal Windows Apps have a HamburgerMenu or a Back Button on the title bar, it would be incredible if SDK had it too, so the developer who makes really small-layout widgets could have a consistent and would not have to worry about how to fit a button or some option into the widget's limited layout? It cloud be the widget icon to be clickable or just like our "pin" and "settings" buttons!

Describe alternatives you've considered
I've considered some options like: using keyboard actions and even in-layout navigation methods, but none of them proved itself consistent or user-graceful to be used.

Additional context
A really good example of this is the Youtube Gamebar Overlay which is a small-layout and intended to be used pinned widget which has a keyboard action to go back on its main page. It all the layout to playback the videos and by so, no in-layout buttons should be a great option.

Hope for the best, great work on SDK!

[ERROR] While building app packages: Manifest references file 'Microsoft.Gaming.XboxGameBar.dll' which is not part of the payload

I believe I have followed all of documentation steps to port my app to the gamebar. It works just fine in bot debug and release mode. But I get this issue where the Microsoft.Gaming.XboxGameBar.dll cannot be found and not added to the package when I try to build an app bundle package for the Microsoft store. I have searched around and I cannot find a solution to it. Any help is appreciated.

[Feature request] Fullscreen-mode/setting size, position and "pinned" state of the widget

Is your feature request related to a problem? Please describe.
I cannot get my widget in true fullscreen mode - the top center navigation bar is blocking my manual resize actions and the title bar of the widget itself prevents it from getting sized to the full height of the screen.

Describe the solution you'd like
#1 Add an option "Fullscreen"
#2 Use Z order to keep the top center menu above everything else but please dont block other windows
#3 An API for setting the widget size and pinned state

Describe alternatives you've considered
Bytepatching 'TryResizeWindowAsync', manual setting the height and width by getting a reference from the private member variable of the 'XboxGameBarWidget' instance.

Controller Support, Switch between widgets

Hello, I having an issue with integrating controller support with my widget.

My problem is that when using a controller and being focused on some part of the game bar UI external to my app, eg Widget Menu, I cannot use my controller to get back my widget/ any of the samples you have provided however I know this is possible as Xbox Social or Capture can be navigated into. (When i first open my app it has focus and i can navigate around with my controller, the problem occurs once the app has lost focus, by moving away from it).

Before
image

The goal, but for my own app.
image

[SDK BUG] Window closed event handler is not called

Describe the bug

The Closed event handler of the Window object is not called

To Reproduce
Steps to reproduce the behavior:

  1. Open the WidgetAvSampleCs sample
  2. Add a breakpoint to the Widget1SettingsWindow_Closed and Widget1Window_Closed method
  3. Observe that the breakpoint of the first method is called when the settings window is closed, but the one of the main window is not called.

Expected behavior

The Closed event handler for all windows should be called.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS version: Windows 10 2004 build 19041.329
  • Game Bar version 5.320.6122.0
  • SDK version: 5.3.200605002

Additional context
Add any other context about the problem here.

[SDK BUG] Gamebar resizes preferences window to a different size than specified

Describe the bug

After a recent gamebar update, a preferences window will be resized to a size different from what is specified in the manifest.

To Reproduce
Steps to reproduce the behavior:

  1. Open the WidgetAvSampleCs sample
  2. Change the size of the preferences window in the manifest to something different (e.g. the height to 600)
  3. Open the widget in the gamebar and click on the preferences button
  4. The window will be opened at the correct size for a split second but will then will be resized

Expected behavior
The window size should follow the size defined in the manifest

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS version: Windows 10 2004 (19041.264)
  • Game Bar version 5.320.5221.0
  • SDK version: XboxGameBar.5.1.200402003

Additional context
Add any other context about the problem here.

[SDK BUG] Error when closing certain widgets

Describe the bug
At first I thought it was the fault of the widget that I was developing. But it seems to be happening to the Resources widget, almost every time. It is also happening to a third party widget I tested. When it is closed, the following error happens:

Failure to write an application setting for package Microsoft.XboxGamingOverlay_8wekyb3d8bbwe. Error Code: -2147009080

My application will only show this error maybe 10% of time and always randomly. When I'm running in debug mode, it attempts to launch a debugger but I can't step through the code, since it's a referenced library.

This is the error from my application:

Faulting application name: GameBar.MyApp.exe, version: 1.0.0.0, time stamp: 0x5c889173
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.19041.572, time stamp: 0x789abd1c
Exception code: 0xc0000005
Fault offset: 0x0029d8a3
Faulting process id: 0x7b40
Faulting application start time: 0x01d6c20d93630986
Faulting application path: C:\UWP Projects\GameBar.MyApp\GameBar.MyApp\bin\x86\Debug\AppX\GameBar.MyApp.exe
Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll
Report Id: 6c016c67-0547-4d78-90f0-d8874a13f6b6
Faulting package full name: 046167b3-59b3-4e86-bb4b-6937e1c4de70_1.0.0.0_x86__4t1fagrdpxhba
Faulting package-relative application ID: App

To Reproduce
Steps to reproduce the behavior:

  1. Go to Xbox Game Bar
  2. Launch Resources Widget
  3. Close it
  4. See error in the event viewer

Desktop (please complete the following information):

  • OS version: Windows 10 20H2
  • Game Bar version 5.420.10222.0
  • SDK version: XboxGameBar.5.3.200605002

Support for widgets in non-UWP apps (WinUI 3)

Is your feature request related to a problem? Please describe.
Currently, building an overlay requires using a UWP app as a base. This immediately locks out use of any libraries or features from .NET 5 as well as anything newer than .NET Standard 2.0.

Additionally, Project Reunion no longer includes any planned roadmap for supporting newer features (WinUI 3, .NET 5 support, etc) in UWP apps.

Describe the solution you'd like
Ideally, I'd like to be able to add a widget from a "modern" WPF app (such as one created by the new production-supported WinUI 3 Desktop templates from Project Reunion), thus allowing for creating a widget without being hamstrung by UWP's increasingly acute limitations.

As it stands, I am unable to use any library, component or code created since about 2018 (i.e. since .NET Standard 2.1) on top of not being able to use .NET 5, WinUI 3, SDK-style projects or newer C# features.

Describe alternatives you've considered
Given the focus on the "enhance" and "extend" stories for making Windows 10 APIs available through packaged Win32/WPF apps and the availability of bridging options like XAML Islands, I would hope there was some alternative method of providing a widget.

Additional context
I understand that a lot of the culprit here lies with UWP itself, but to be clear, my request is specifically whether there is a supported method of providing Game Bar widgets from any target/platform other than UWP.

NamedPipeClientStream.Connect throws IOException "This functionality is not supported in the context of an app container"

We'd like to communicate with our desktop app via named pipes.
SDK docs mention named pipes in "Inter-process communication options" section along with RPC, so I expected this to work.

I don't have the actual Game Bar widget in the project yet, so far I only wanted to check whether pipes would work: basically this is blank UWP project with custom capability declared and SCCD added to it.
I have followed Custom Capability sample (https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/CustomCapability), but instead of RPC server I create named pipe in desktop app: CreateNamedPipe + ConnectNamedPipe.

Whenever I call NamedPipeClientStream.Connect from UWP, it throws IOException with message "This functionality is not supported in the context of an app container", but on server side (desktop app) ConnectNamedPipe succeeds - it returns TRUE in synchronous mode.

The custom capability part seems to work fine, because if I remove custom capability declaration from appxmanifest, NamedPipeClientStream.Connect throws UnauthorizedAccessException instead.

I've tried 'byte' and 'message' pipe types on server side, result is always the same.

Are named pipes supported?
If not, please update SDK docs to reflect this.

Windows 10, Version 1909 (18363.693).

[Question] Application activation for a VB project?

I have an application that I am trying to make for the XboxGameBar and as a standalone application it works great. when I use the game bar to open the widget the window opens like it is supposed to but the WebView (only thing on it atm) just spins and never works.

I am assuming this is related to the way that VB uses it's sub classes to load the form and such ex. Protected Overrides Sub OnLaunched

Is their a way to activate a VB project properly? I see that for C++ it wants you to use OnActivated

[SDK BUG] Pinned widgets capture mouse when minimized

Describe the bug
Pinned widgets capture mouse and block interaction with underlying applications after being minimized.

To Reproduce
Steps to reproduce the behavior:

  1. Pin widget.
  2. Minimize widget.
  3. Try to interact with underlying application in the area where the widget was located.

Expected behavior
Pinned widget should not capture mouse after being minimized.

Screenshots
gamebar

Desktop:

  • OS version: Windows 10 1909 build 18363.900
  • Game Bar version 5.320.6242.0
  • SDK version: 5.3.200605002

[SDK BUG] XboxGameBarWebAuthenticationBroker Fails With CallbackUri Containing "ms-app://"

Describe the bug
While attempting to use XboxGameBarWebAuthenticationBroker to authenticate with a third-party OAuth2 endpoint, I received uncaught exceptions with the following message:

Exception thrown: 'System.ArgumentException' in System.Private.CoreLib.dll
An exception of type 'System.ArgumentException' occurred in System.Private.CoreLib.dll but was not handled in user code
Value does not fall within the expected range.

With the stack trace:

 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at PackageName.MainPage.<button_Click>d__4.MoveNext() in C:\Users\moudi\source\repos\PackageName\PackageName\MainPage.xaml.cs:line 49

Using the regular UWP WebAuthenticationBroker does work with my game bar widget, but the UI behavior is erratic. Clicking a button that calls AuthenticateAsync will minimize the Game Bar, and not always succeed in launching a webview.

XboxGameBarWebAuthenticationBroker doesn't seem to have documentation available anywhere other than its usage in the sample code in this repo, so I may be setting it up or using it incorrectly.

To Reproduce

  • Initialize an instance of XboxGameBarWebAuthenticationBroker in an application.
  • Create a System.Uri instance containing a URL for the broker to navigate to. My application is attempting to authenticate with the Bungie API for example, using https://www.bungie.net/en/OAuth/Authorize?client_id=<snip>&state=random&response_type=code
  • Call AuthenticateAsync, such as the following:
XboxGameBarWidget _widget; // Initialized in OnActivated
var broker = new XboxGameBarWebAuthenticationBroker(_widget);
var resp = await _broker.AuthenticateAsync(XboxGameBarWebAuthenticationOptions.None, authUri, WebAuthenticationBroker.GetCurrentApplicationCallbackUri());
  • The call will succeed with a callbackUri parameter using any scheme other than ms-app://, from my testing. Authentication will fail, as the application has no other way to receive the callback.

Expected behavior
Behavior similar to the WebAuthenticationBroker class. WebAuthenticationBroker.AuthenticateAsync uses the ms-app: scheme by default for its callback URI when one is not provided.

Desktop (please complete the following information):

  • OS version: Windows 10 2004 (OS Build 19041.329)
  • Game Bar version 5.320.6122.0
  • SDK version: XboxGameBar.5.3.200605002

Additional Context
I did attempt to define a custom protocol handler (e.g. set <uap:Extension Category="windows.protocol"> and handle URI activation in my widget), but I instead get the following exception:

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
An exception of type 'System.IO.FileNotFoundException' occurred in System.Private.CoreLib.dll but was not handled in user code
The specified protocol is unknown. (Exception from HRESULT: 0x800C000D)

[SDK BUG] When using desktop resolution taskbar pushing widget up

Describe the bug
Issue where unable to set widget size to maximum. Screen resolution is 2560 x 1440.
Either top xbox game bar pushing the widget down or the bottom task bar. If widget is reset in Personalization, then the xbox game bar doesn't push it down, but bottom task bar still pushes it up. I've tried even hiding task bar but still doesn't work

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'change window size height/width to what ever screen resolution is (this is to set to have full screen widget)'
  2. Click on 'run app and game bar widget / task bar will pushed the widget down (from top) and up from (bottom)'
  3. Scroll down to '....'
  4. See error

Expected behavior
Like to get it fully working in full screen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS version: [use winver e.g. Windows 10 1909 build 18363.720]
  • Game Bar version [open Game Bar (Win+G), open settings, open general tab, e.g. 5.120.3262.0]
  • SDK version: [which NuGet package are you using, e.g. XboxGameBar.5.1.200326002]

Additional context
Add any other context about the problem here.

Vulkan API Support

Is your feature request related to a problem? Please describe.
Customers have expressed frustration to us that our Game bar widget does not work in games running with Vulkan API instead of DirectX. Red Dead Redemption 2 is a good example.

Describe the solution you'd like
Ideally, seamless Vulkan API support for Game Bar widgets.

Describe alternatives you've considered
I direct all customer support inquiries to run their game in DirectX 11/12 instead of Vulkan if they have the option. Many times they've explicitly asked for Vulkan support and I know that's not in my control.

[SDK BUG] App-to-App Communication Stops working occasionally

Describe the bug
This might be a crapshoot but I'd love to hear your thoughts on areas that I should look into.

Occasionally, (we get one or two emails a day about this), users of the Crosshair X Extension can't connect the Desktop app to the Game Bar widget via the Named Pipes or AppServiceConnection protocol until they restart their PC. Although we've found a solution to temporarily make the problem go away (restarting the PC), it still creates a bad customer experience.

Given that I've tried both protocols and both seem to fail, I'm starting to wonder if there's an issue with UWP / Game Bar.

I've met with customers in Discord and did a thorough troubleshooting session with them. The users of the AppServiceConnection don't ever connect nor do they ever get an error. It's as if it's blocked or something.

To Reproduce
Steps to reproduce the behavior:

  1. Download the Crosshair X app on the Microsoft Store or Steam
  2. Download the Crosshair X Extension on the Game Bar
  3. Eventually it'll bug out (sometimes two weeks after the user purchases it).
  4. Crosshair Won't Update. It'll just say 'Run the Crosshair X Desktop App' indefinitely and they'll have to restart their PC

Expected behavior
Crosshair X connects to the Crosshair X Extension when they're both launched and the Crosshair updates.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS version: Up to date versions of Win 10 and 11, I've asked customers to update and we use Sentry to verify this
  • Game Bar version: Latest Versions, I've asked customers to update and this has been happening for a long time
  • SDK version: Latest version

Additional context
I'm just stumped on this one and am hoping you guys have access to a subject matter expert that could at least point me in a new direction. Not sure if it's something I'm doing wrong as it's only an intermittent issue.

[SDK BUG] Enter key doesn't work in WebView if another window outside the Game Bar is active

Describe the bug
I'm not entirely sure if this is an issue with Game Bar or how I have implemented WebView but if a window is already selected, the Enter/Return key is not passed into the widget's WebView.

To Reproduce
Steps to reproduce the behavior:

  1. Go to your desktop and select any window (taskbar will highlight it).
  2. Open a widget that contains a WebView and go to a site like bing.com.
  3. Press Enter/Return in the search box.

Expected behavior
The Enter key should be passed into the WebView and start the search.

Desktop:

  • OS version: Windows 10 1909 build 18363.720
  • Game Bar version 5.120.4062.0
  • SDK version: XboxGameBar.5.1.200402003

Feature Request: Backwards-compatible SDK releases

It would be very useful if newer SDK builds were backwards compatible with older Xbox Game Bar versions. Coupling new SDKs to Xbox Game Bar versions requires a tricky dance of release coordination which is only exaserbated by Microsoft Store certification times (which I'm currently looking at 3+ days to ship an update).

I mentioned this in the replies to #55 but I thought it warrented its own issue.

I appreciate the technical difficulties involved, but at least from my perspective as a SDK consumer and widget developer, I believe it would be a worthwhile investment to make Game Bar forward compatible with newer SDK releases.

Last week I had prepared a build with new features and bug fixes with the new SDK and was approved in the Microsoft Store for manual release today, which I now have to cancel and submit a new build with old SDK and go through the 3+ day Microsoft Store certification cycle again.

I understand the scope and scale is very different, but an iOS app developer can submit an update to their apps to support new platform features while maintaining compatibility with previous iOS version. I believe it would be exceptionally beneficial for both developers and users if Xbox Game Bar and it's SDK could work similar.

Cheers!

[Features] Documentation to List all Subset of Capabilities/API allowed in Game Bar

Following, as sample of capture over windows to show on widget

  public sealed partial class Widget2 : Page
    {
        private CanvasDevice _device;
        private SimpleCapture _capture;
        private SpriteVisual _visual;

        public Widget2()
        {
            this.InitializeComponent();
            _device = new CanvasDevice();

        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

        }

        private async void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            Windows.Graphics.Capture.GraphicsCapturePicker graphicsCapturePicker = new Windows.Graphics.Capture.GraphicsCapturePicker();
            Windows.Graphics.Capture.GraphicsCaptureItem graphicsCaptureItem = await graphicsCapturePicker.PickSingleItemAsync();

But the capturing window does not show....

Related repo: In Samples
https://github.com/edwardchanjw/game_bar_testing1

Describe the solution you'd like

  • Will it support.
  • List all API supported on Game Bar.....It is quite a steep documentation digging for people from Web to Cloud Era Background

Describe alternatives you've considered

  • Possibly using desktop bridge.. and native...Furthermore, more win32 to learn.

Additional context
I do recommend to support all these API, it is safe, permission gated. Pure Windows Team's Goodness. Good job for Long term Quality. The Team just need to push further. If Windows can be optimized better on overlay. Steam overlay can be disable. But Steam's Chat, Community, Achievement (Can be team up with Google/Epic to create open Achievement standard, like Mozilla badges), Marketplace for emote, item, still one way ahead.

Game Bar notification support

Is your feature request related to a problem? Please describe.
When Focus Assist is enabled with an automatic rule for playing a game, regular Windows notifications are silent.

Describe the solution you'd like
The ability to issue notifications from in the Game Bar like the Xbox Social widget is able to.

Describe alternatives you've considered
Trying to display messages within our widget and playing sounds in to let a player know, in case the widget is not pinned. The downside of this is that if the widget is unpinned, the only way to know what the message is, is to open Game Bar. This could also coincide with notifications from other widgets like Xbox Social.

Additional context
This is the notification system Xbox Social is making use of that we'd like to make use of as well.

C# samples unsupported by Visual Studio 2019

Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.

  • WidgetSampleCS, "C:\temp\WidgetSampleCS\WidgetSampleCS.csproj"

No changes required
These projects can be opened in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.

  • WidgetSampleCS, "C:\temp\WidgetSampleCS\WidgetSampleCS.sln"

Could perhaps need an upgrade?

How do I allow my app to be detected by game bar as a game?

I wasn't able to find a good place to post this but here seemed the most appropriate. I have developed a UWP game using Xamarin.Forms. It doesn't use DirectX/OpenGL etc. It is a game though. How can I ensure game bar automatically detects this app as a game without the user needing to manually flag it for gamebar?

[SDK BUG] MinWindowSize/MaxWindowSize works unexpectedly

Describe the bug
MinWindowSize function do not work expectedly, and MaxWindowSize function makes the program crash.

To Reproduce
Steps to reproduce the behavior:

  1. Clone and build WidgetAdvSample
  2. Debug in x64 mode; Win+G
  3. Click on SetMinWindowSize (behavior 1)
  4. Click on SetMaxWindowSize (behavior 2)

Behavior & Screenshots

  1. after MinWindowSize({800, 600}), the window can be resized to very small.
    gamebar1
  2. after MaxWindowSize, nothings happens. But when you try to resize or drag the window, the whole game bar crashed (how can i get the crash log?).

Desktop:

  • OS version: Windows 10 2004 build 19041.264
  • Game Bar version 5.320.5291.0
  • SDK version: XboxGameBar v5.1.200401003
  • Target platform version: Windows 10.0.19041.0 (Tried 10.0.17763.0 also)

Startup some one GameBar widget by .net program(WPF) [feature request]

Is your feature request related to a problem? Please describe.
I want to open the GameBar widget by WPF (maybe on button click)

Describe the solution you'd like
We can open GameBar menu by Win key + G key now.
So I think that can provide some window api like OpenWidget(Id) to open widget .

Describe alternatives you've considered
I can use keyboard hook send Win key + G key to open GameBar menu only, but It is not enough.

Make widgets visible for streaming tools.

I have game overlay that is hosted on xbox gamebar. Problem is what streaming tools like OBS and Discord don't capture it.

It would be nice if there is a way to make xbox gamebar widgets visible for streaming tools in pinned mode.

Support For React Native Windows

Is your feature request related to a problem? Please describe.
Trying to run react-native within as a Widget causes a crash with the following error

ReactInUWP.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

looking at the packager log it seems there was no request to the packager.

Describe the solution you'd like
I think (if it's possible) a sample would be more than enough.

Additional context
code -> https://gist.github.com/ShoeBoom/1e2ec26df57c576c5f20e5b0f29800bb

[Question] How to respond correctly to XboxGameBarWidget.RequestedThemeChanged?

Whenever I try to set the new value of XboxGameBarWidget.RequestedTheme an exception with message "The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))" is throwed. I tried run an action using the Window.Current.Dispatcher and CoreApplication.MainView.CoreWindow.Dispatcher but without success. So, how can I do it?

Expanding the Looking for Group feature

Hi Devs,

As indicated in the title, It kind of bothers me that this feature is incredibly small on the pc side of things, especially for older games on the platform it can be quite a hassle to find people for Co-Op or Comp modes. But to my surprise not even half of the Gamepass for pc games use the Gamebar Looking for Group function. For many older Xbox games this was the only viable way to find people, especially for backwards compatible 360 games. I had great fun filling 12 man lobbies on otherwise dead 360 games.

I'm running into this issue, as I'm trying to play a multiplayer game in the game World War Z for Windows 10, but the issue here is that the game doesn't have a player base large enough to get 4 people searching for multiplayer at the same time. Nor has a specific community I know of that exclusively is tied into the Win 10 version as the multiplayer isn't crossplatform.

To give an example:
On the gaming site Trueachievements 100000+ people have played the Xbox version and the Win 10 version has less then 5000 total players.

So what do I hope to see, well it's easy for me to say but I would love an expansion to the looking for group feature on Gamebar to atleast include relevant gamepass for pc games (not games without multiplayer for example).

I have tried to find an community as an alternative but these are to my knowledge non-existent

I do love the gamebar feature for pc it makes parties etc a good and pleasant experience

Keep up the great work improving it

Dutch x Monster

This is close to the greatest recording software known to man.. except

Where is 1. My volume levels for my mic?
and 2. more importantly and the purpose of this entire feedback...
CAN I GET A NOISE GATE PLEASE??

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
The problem is when I'm not talking .. you can hear the static in the room

Describe the solution you'd like
A clear and concise description of what you want to happen.
Just need either a widget or a function built in to add a noise gate on your microphone...

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Recording my audio seperately in my DAW.. Works but crazy long process plus lining up plus many errors and things can go wrong from here to there..
Tried Muffling the sound of my pc.. Rediculously impossible..
TRIED getting a whole NEW recording software even though this ones damn near perfect..
Why cant yall just add a quick feature?

Additional context
Add any other context or screenshots about the feature request here.
I think I've made my point Thanks for listening and hopefully solving this =)

Much love~

Widget apps cannot specify they are multi-instance

Widget apps cannot specify they are multi-instance (desktop4:SupportsMultipleInstances). If they do it will cause Game Bar and Windows Explorer to crash. This issue does not prevent you from having multiple widgets on the same app. That scenario does not require the desktop4:SupportsMultipleInstances attribute to be set.

[Question] How to setup RestrictedSample. I can do sample code on same solution, but not on new project.

Describe
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Copy RestrictedSamples's widget to WidgetAdvSampleCS's widget1 and widget2..
    a. Update NETCore.UniversalWindowsPlatform nuget to 1 more version. WidgetAdvSampleCS is one version behind
    b. Copy Extensions\DispatcherTaskExtensions
    c. Copy widget1 class entirely

Expected behavior

  1. The file picker should not crashed...
  2. If Debug it is
 System.UnauthorizedAccessException
  HResult=0x80070005
  Message=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

Additional context
I am no sure, I feeling kinda stupid to even merge two sample.
Any other config/setting or nuget update need to be done?
The project's solution Link

Probably I doing wrong with these? But I haven click the widget 1's file picker and never clean it, before clicking widget2's file picker
// Also, at this time you should let the XboxGameBarForegroundWorker object fall out of scope, as it is only allowed to be used once

[SDK BUG] Using TryResizeWindowAsync when Game Bar is pinned only is broken

Describe the bug
If you have a pinned widget and Game Bar's display mode is currently PinnedOnly, calling TryResizeWindowAsync will resize the widget, but not the clipping region. As such, if the widget is made smaller, the now blank region will still not let you click through, and if you make the widget bigger, the expanded region is not visible.

To Reproduce

  1. Have a widget which is pinnable and can call TryResizeWindowAsync.
  2. Pin widget and close Game Bar.
  3. Perform an action with it that will call "TryResizeWindowAsync".
  4. If made smaller, try clicking a region where the widget used to occupy.

Expected behavior
The expected behavior is that resizing my widget will result in the rendering and interactive region changing to that size, even when pinned. Currently it only behaves this way if Game Bar's Display Mode is Visible.

Screenshots

Desktop (please complete the following information):

  • OS version: Windows 10 1909 (OS Build 18363.778)
  • Game Bar version: 5.120.4062.0
  • SDK version: XboxGameBar.5.1.200402003

Additional context
There seems to be a related problem where sometimes if you hit "Restart" on "Something went wrong with this widget" while it's pinned, or when the widget enters that state after having been resized during running, the window position/size will change slightly, but the clipped region also remains the same, however I do not have reliable reproduction steps for this.

[Question] window not pinning

I'm wondering if there is something more to pinning, than just setting <PinningSupported>true</PinningSupported> and inside gamebar clicking the pin, cause mine is not pinning at all, I'm able to pin performance, but for some reason mine is not pinning.
any help would be appreciated.

[SDK BUG] Pinned Widgets with 'Enabled Clickthrough' aren't actually click through on PC Startup

Describe the bug
Pinned Widgets with 'Enabled Clickthrough' aren't actually click through on PC Startup until the Game Bar is opened and closed (Win + G pressed twice consecutively)

To Reproduce
Steps to reproduce the behavior:

  1. Pin any widget.
  2. Press 'Enable Click-through' in the Game bar menu.
  3. Restart your PC and wait for the pinned widget to boot on startup, DONT press Win + G prior.
  4. Try clicking inside the boundaries of the widget.

Expected behavior
Pinned widget with 'Enabled Clickthrough' should always be click through.

Screenshots
I took a video, I hope this helps :)

https://www.youtube.com/watch?v=y2a292AyMxM

Desktop (please complete the following information):

  • OS version: Windows 10 Pro, Version 10.0.19042 Build 19042
  • Game Bar version: 5.521.3093.0
  • SDK version: 5.3.200605002

[QUESTION] Widget to execute arbitrary exes

Is it possible to create a widget that can run an .exe file if one is provided? I'm wondering if it is possible to develop a shortcut menu so users can pin and launch their games from the Xbox Game Bar.

[BUG] Sample Package.appxmanifest, does not describe as it is.

Describe the bug
XboxGameBarSamples/Samples/WidgetAdvSampleCS/Package.appxmanifest
Line 45 and 75, both two extension having a swap?

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'XboxGameBarSamples/Samples/WidgetAdvSampleCS/Package.appxmanifest'
  2. Widget1 and Widget1Settings is no what they mean.

Expected behavior
Swap Widget1 and Widget1Settings

[SDK BUG] Cannot type with v5.3

Describe the bug
When you have an app selected, and then you use a widget, you cannot type. This issue was not present with v5.1.

To Reproduce
Steps to reproduce the behavior:

  1. Have a widget with text boxes.
  2. Select an app, such as a web browser.
  3. Open the Game Bar and try to type within the widget.

Expected behavior
Keyboard input should be sent to the widget.

Desktop (please complete the following information):

  • OS version: Windows 10 1909 build 18363.959
  • Game Bar version: 5.420.7201.0
  • SDK version: 5.3.200605002

When using the default Visual Studio project template for a UWP C++/WinRT application you may find encounter linker errors.

When using the default Visual Studio project template for a UWP C++/WinRT application you may find encounter linker errors. The errors indicate that they cannot recognize the version of C++/WinRT package that was installed.

To work around this, right click and your project and select Properties. Navigate to Configuration Properties -> Linker -> Input -> Additional Dependencies and add "OneCore.lib". Be sure to and save your changes.

Question: Creating first widget, can't get to show window, throws exception.

I've been following along with the development guide, and I've got it to activate properly, but the window doesn't show. When debugging, I get this error when I try to open the widget:

Exception thrown at 0x77CB4402 (KernelBase.dll) in DailyTracker.exe: WinRT originate error - 0x80040155 : 'Failed to find proxy registration for IID: {FD037AC2-5D3A-438D-BD53-88F0B6B0F399}.'.

Not quite sure what do try at this point. I'm pretty new to this environment too. My project is in C++/CX if that matters. The guide has been in C++/CLI I think? So I've had to modify the code a bit to get different parts to just compile.

The error makes me think the proxy/stub registration I had to add to the manifest is wrong somehow (no idea what this actually does), but I've done exactly what the guide said to add:

<Extensions>
    <Extension Category="windows.activatableClass.proxyStub">
      <ProxyStub ClassId="00000355-0000-0000-C000-000000000046">
        <Path>Microsoft.Gaming.XboxGameBar.winmd</Path>


        <!-- include when using SDK version 5.1+-->
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetAuthHost" InterfaceId="DC263529-B12F-469E-BB35-B94069F5B15A" />
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetControlHost" InterfaceId="C309CAC7-8435-4082-8F37-784523747047" />
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarNavigationKeyCombo" InterfaceId="5EEA3DBF-09BB-42A5-B491-CF561E33C172" />
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetActivatedEventArgsPrivate" InterfaceId="782535A7-9407-4572-BFCB-316B4086F102" />
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetHost" InterfaceId="5D12BC93-212B-4B9F-9091-76B73BF56525" />
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetPrivate" InterfaceId="22ABA97F-FB0F-4439-9BDD-2C67B2D5AA8F" />

        <!-- include when using SDK version 5.3+-->
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetHost2" InterfaceId="28717C8B-D8E8-47A8-AF47-A1D5263BAE9B" />
        <Interface Name="Microsoft.Gaming.XboxGameBar.Private.IXboxGameBarWidgetPrivate2" InterfaceId="B2F7DB8C-7540-48DA-9B46-4E60CE0D9DEB" />

      </ProxyStub>
    </Extension>
  </Extensions>

I've got version 5.1.200402003 of XboxGameBar installed, so shouldn't need the last two InterfaceId lines. But I've tried it with them just to make sure, and still get the error.

Sorry if this isn't the right spot for this, but its the only discussion area I could find!

Customers are asking for widget centering

Background:
My name is Sandra and I am reaching out to request a feature on behalf of the Crosshair X community. Crosshair X is a rapidly growing custom crosshair overlay app that uses a game bar widget to overlay games. We are currently in the top 5 widgets on the widget store and we love the game bar platform.

The Problem:
We are getting multiple support emails every day asking for a button that just automatically centers the widget.
Our current solution involves instructing the user to drag the widget to the desired location and then using hotkeys to move the crosshair pixel by pixel until it's in the center.
Link to gif
As you can see, it is quite tedious and not intuitive for the customer.

The Solution:
There are a few ways to solve the problem but at the end of the day, we are just trying to easily center our widget.
The following are the two solutions that I can think of to solve the issue.

  1. An API that lets us get and set the coordinates of the widget.
  2. An API call that automatically centers the widget
    Either one of these solutions would allow us to give our customers the feature they have been asking for.

Transparency for custom widgets

Is your feature request related to a problem? Please describe.
For a widget I'm working on, a common use for it will involve it being pinned over top of a game, but since widgets can't be transparent, the area taken up by our widget will completely obscure that area of the screen. Any attempt to adjust opacity of controls just reveals a white background.

Describe the solution you'd like
The solution we would like to see is to let us have the option to remove the background for the frame so that we can have control over the transparency of our widget and its controls, like the Performance widget already does.

Describe alternatives you've considered
We could not come up with any alternatives. Either the widget has transparency and doesn't obscure part of the screen, or it doesn't have transparency.

Additional context
Example of the Performance widget's transparency.

We do know that the widget does not become a part of the Game Bar layout, and is instead a remote view. We confirmed that opacity changes in the Game Bar layout through debugging also affect the white background. Additionally we confirmed that our widget does not contain a background as part of it's layout that could explain the white background. This leads us to suspect that the remote view does not support an alpha channel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.