Check API before trying to disable border on WGC capture#2825
Check API before trying to disable border on WGC capture#2825ReenigneArcher merged 1 commit intoLizardByte:masterfrom
Conversation
|
Do you think we should just remove the whole try/catch, especially considering the catch isn't working anyway. |
|
Force-pushed an update, now it looks like this return -1;
}
/*
Currently this triggers a segmentation fault on Windows 10
According to
https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired
we are expected to request user's consent first, but doing
winrt::GraphicsCaptureAccess::RequestAccessAsync(winrt::GraphicsCaptureAccessKind::Borderless);
accomplishes nothing, probably requiring an entry in app's manifest
try {
capture_session.IsBorderRequired(false);
}
catch (winrt::hresult_error &e) {
BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to disable border around capture area: [0x"sv << util::hex(e.code()).to_string_view() << ']';
}
*/
try {
capture_session.StartCapture(); |
|
Is there a good reason to even allow WGC usage on Windows 10? I believe it was missing useful functionality like |
|
Well, some support is better than no support at all. And it performs rather well outside of those two(?) things. |
|
Yeah, checking for property presence resolves the segfault. Pushed a proper fix. Now we just need to confirm that the fix works alright on Windows 11. |
Otherwise it causes segmentation fault on Windows 10.
c536326 to
bed96ae
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2825 +/- ##
=======================================
Coverage 8.98% 8.99%
=======================================
Files 95 95
Lines 17304 17312 +8
Branches 8232 8236 +4
=======================================
+ Hits 1555 1557 +2
- Misses 12884 13046 +162
+ Partials 2865 2709 -156
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I tested, and it's working fine. |
Description
Using the new WGC capture method on Windows 10 currently causes a segmentation fault.
This should resolve it.
Screenshot
Issues Fixed or Closed
Type of Change
.github/...)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.