Skip to content

Commit c13a969

Browse files
committed
fix popup on wid mode
1 parent 8131062 commit c13a969

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

source/player.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void Player::initGui() {
201201
if (config->Data.Interface.Docking) io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
202202
#endif
203203
#ifdef IMGUI_HAS_VIEWPORT
204-
if (config->Data.Interface.Viewports) io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
204+
if (config->Data.Interface.Viewports || config->Data.Mpv.UseWid) io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
205205
#endif
206206

207207
loadFonts();

source/window.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,15 @@ void Window::setupWin32Taskbar() {
397397
LRESULT CALLBACK Window::wndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
398398
auto win = reinterpret_cast<Window*>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
399399
switch (uMsg) {
400+
case WM_NCLBUTTONDOWN:
401+
case WM_NCRBUTTONDOWN:
402+
case WM_NCMBUTTONDOWN:
403+
case WM_NCXBUTTONDOWN:
404+
if (win->config->Data.Mpv.UseWid && ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopup)) {
405+
ImGuiIO& io = ImGui::GetIO();
406+
io.AddFocusEvent(false); // may close popup
407+
}
408+
break;
400409
case WM_NCACTIVATE:
401410
case WM_NCPAINT:
402411
if (win->borderless) return DefWindowProcW(hWnd, uMsg, wParam, lParam);

0 commit comments

Comments
 (0)