Skip to content

Commit 304079a

Browse files
authored
Revert "SetThreadDpiAwareness for host error dialog (#81930)" (#85773)
This reverts commit 6f36be5. There is an issue with the Windows TaskDialog where expanding/collapsing the detail area will result in incorrect resizing of the window when the DPI awareness of the process and thread are not the same. Instead of explicitly making the thread starting the dialog DPI aware, we just leave it whatever the process is set to. This means that if the developer specified a manifest that made their application DPI aware, the dialog will be non-blurry, but if the developer did not, it will remain blurry on high DPI.
1 parent bc76652 commit 304079a

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/native/corehost/apphost/apphost.windows.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -323,20 +323,6 @@ namespace
323323

324324
trace::verbose(_X("Showing error dialog for application: '%s' - error code: 0x%x - url: '%s' - details: %s"), executable_name, error_code, url.c_str(), details.c_str());
325325

326-
HMODULE user32 = ::LoadLibraryExW(L"user32.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
327-
if (user32 != nullptr)
328-
{
329-
using set_thread_dpi = DPI_AWARENESS_CONTEXT(WINAPI*)(DPI_AWARENESS_CONTEXT context);
330-
set_thread_dpi set_thread_dpi_func = (set_thread_dpi)::GetProcAddress(user32, "SetThreadDpiAwarenessContext");
331-
332-
// Since this is only for errors shown when the process is about to exit, we
333-
// skip resetting to the previous context to minimize impact on apphost size
334-
if (set_thread_dpi_func != nullptr)
335-
(void) set_thread_dpi_func(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
336-
337-
::FreeLibrary(user32);
338-
}
339-
340326
if (enable_visual_styles())
341327
{
342328
// Task dialog requires enabling visual styles

0 commit comments

Comments
 (0)