Skip to content

Commit

Permalink
fix: Graphics Capture 更早还原源窗口样式
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Mar 3, 2023
1 parent 7d9d8d9 commit 9aae602
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Magpie.App/Resources.language-zh-Hans.resw
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
<value>启用便携模式</value>
</data>
<data name="Settings_DeveloperOptions.Description" xml:space="preserve">
<value>These settings are for development use only</value>
<value>这些设置仅供开发使用</value>
</data>
<data name="Settings_DeveloperOptions.Title" xml:space="preserve">
<value>开发者选项</value>
Expand Down
10 changes: 10 additions & 0 deletions src/Magpie.Core/GraphicsCaptureFrameSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ bool GraphicsCaptureFrameSource::_CaptureWindow(IGraphicsCaptureItemInterop* int
Logger::Get().Error("创建 ITaskbarList 失败");
}

// 上面的尝试失败了则还原更改
if (_taskbarList) {
_taskbarList->DeleteTab(hwndSrc);
_taskbarList = nullptr;
}
if (_originalSrcWndExStyle) {
SetWindowLongPtr(hwndSrc, GWL_EXSTYLE, _originalSrcWndExStyle);
_originalSrcWndExStyle = 0;
}

return false;
}

Expand Down

0 comments on commit 9aae602

Please sign in to comment.