Skip to content

Commit

Permalink
fix popup on wid mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Feb 22, 2024
1 parent 8131062 commit c13a969
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void Player::initGui() {
if (config->Data.Interface.Docking) io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
#endif
#ifdef IMGUI_HAS_VIEWPORT
if (config->Data.Interface.Viewports) io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
if (config->Data.Interface.Viewports || config->Data.Mpv.UseWid) io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
#endif

loadFonts();
Expand Down
9 changes: 9 additions & 0 deletions source/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ void Window::setupWin32Taskbar() {
LRESULT CALLBACK Window::wndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
auto win = reinterpret_cast<Window*>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
switch (uMsg) {
case WM_NCLBUTTONDOWN:
case WM_NCRBUTTONDOWN:
case WM_NCMBUTTONDOWN:
case WM_NCXBUTTONDOWN:
if (win->config->Data.Mpv.UseWid && ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopup)) {
ImGuiIO& io = ImGui::GetIO();
io.AddFocusEvent(false); // may close popup
}
break;
case WM_NCACTIVATE:
case WM_NCPAINT:
if (win->borderless) return DefWindowProcW(hWnd, uMsg, wParam, lParam);
Expand Down

0 comments on commit c13a969

Please sign in to comment.