MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / ShouldUseXamlMenu

Method ShouldUseXamlMenu

TranslucentTB/tray/basecontextmenu.cpp:150–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150bool BaseContextMenu::ShouldUseXamlMenu()
151{
152 if (!m_UseXamlMenu)
153 {
154 static const bool xamlMenuWorks = []
155 {
156 if (win32::IsAtLeastBuild(19045))
157 {
158 // Windows 10 22H2 and up (including Windows 11) - always works
159 return true;
160 }
161 else if (win32::IsAtLeastBuild(19041))
162 {
163 // Windows 10 21H2, 21H1, 20H2, 2004 - requires KB5007253 (which is revision number 1387 on all of those)
164 if (const auto [version, hr] = win32::GetWindowsBuild(); SUCCEEDED(hr))
165 {
166 return version.Revision >= 1387;
167 }
168 else
169 {
170 return false;
171 }
172 }
173 else
174 {
175 // older than 2004 - always broken
176 return false;
177 }
178 }();
179
180 return xamlMenuWorks;
181 }
182 else
183 {
184 return *m_UseXamlMenu;
185 }
186}
187
188void BaseContextMenu::ShowClassicContextMenu(const wuxc::MenuFlyout &flyout, POINT pt)
189{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected