Merge pull request #229 from ZhunCn/fix-discord-streaming

Workaround for Discord Screensharing on Windows
This commit is contained in:
edde746
2026-01-12 03:28:07 +01:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -30,13 +30,15 @@ HWND MpvContainer::Create() {
::RegisterClassExW(&window_class);
// Use WS_POPUP for a borderless window without title bar.
// Use WS_EX_TOOLWINDOW | WS_EX_NOREDIRECTIONBITMAP to prevent shadow and DWM effects.
handle_ = ::CreateWindowExW(
WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_NOREDIRECTIONBITMAP,
WS_EX_APPWINDOW,
kClassName, kWindowName, WS_POPUP,
0, 0, 100, 100, nullptr, nullptr,
GetModuleHandle(nullptr), nullptr);
// Set the window to be fully opaque. This forces a redirection surface.
::SetLayeredWindowAttributes(handle_, 0, 255, LWA_ALPHA);
// Disable DWM animations on the container.
auto disable_window_transitions = TRUE;
DwmSetWindowAttribute(handle_, DWMWA_TRANSITIONS_FORCEDISABLED,
+1 -1
View File
@@ -37,7 +37,7 @@ class MpvContainer {
ITaskbarList3* taskbar_ = nullptr;
static constexpr wchar_t kClassName[] = L"MPV_CONTAINER";
static constexpr wchar_t kWindowName[] = L"";
static constexpr wchar_t kWindowName[] = L"Plezy Video Stream";
static std::unique_ptr<MpvContainer> instance_;
};