Skip to content

Commit

Permalink
fix playlist scrollbar glitch in Windows 7 (#2919)
Browse files Browse the repository at this point in the history
  • Loading branch information
adipose committed Jul 13, 2024
1 parent 85c03f4 commit bdb25a2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mpc-hc/CMPCThemeScrollBarHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ void CMPCThemeScrollBarHelper::setWindowRegionExclusive(HRGN h) {
void CMPCThemeScrollBarHelper::hideNativeScrollBars()
{

if (!CMPCThemeUtil::IsWindowVisibleAndRendered(window)) {
return;
}

bool windowChanged = helperInfo.UpdateHelperInfo(window);

ScrollBarHelperInfo& i = helperInfo;
Expand Down
14 changes: 14 additions & 0 deletions src/mpc-hc/CMPCThemeUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,3 +1243,17 @@ void CMPCThemeUtil::AdjustDynamicWidgetPair(CWnd* window, int leftWidget, int ri
}
}
}

bool CMPCThemeUtil::IsWindowVisibleAndRendered(CWnd* window) {
if (!window || !IsWindow(window->m_hWnd) || !window->IsWindowVisible()) {
return false;
} else {
CRect r;
HDC hdc = GetWindowDC(window->m_hWnd);
GetClipBox(hdc, &r);
if (r.IsRectEmpty()) {
return false;
}
}
return true;
}
1 change: 1 addition & 0 deletions src/mpc-hc/CMPCThemeUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class CMPCThemeUtil
static void fulfillThemeReqs(CProgressCtrl* ctl);
static void enableWindows10DarkFrame(CWnd* window);
static void AdjustDynamicWidgetPair(CWnd* window, int left, int right, WidgetPairType lType = WidgetPairAuto, WidgetPairType rType = WidgetPairAuto);
static bool IsWindowVisibleAndRendered(CWnd* window);

void PreDoModalRTL(LPPROPSHEETHEADERW m_psh);

Expand Down

0 comments on commit bdb25a2

Please sign in to comment.