Index: reactos/win32ss/user/ntuser/display.c =================================================================== --- reactos/win32ss/user/ntuser/display.c (revision 71501) +++ reactos/win32ss/user/ntuser/display.c (working copy) @@ -10,6 +10,7 @@ DBG_DEFAULT_CHANNEL(UserDisplay); BOOL gbBaseVideo = 0; +static PPROCESSINFO gpFullscreen = NULL; static const PWCHAR KEY_VIDEO = L"\\Registry\\Machine\\HARDWARE\\DEVICEMAP\\VIDEO"; @@ -650,6 +651,17 @@ return Status; } +VOID +APIENTRY +UserUpdateFullscreen( + DWORD flags) +{ + if (flags & CDS_FULLSCREEN) + gpFullscreen = gptiCurrent->ppi; + else + gpFullscreen = NULL; +} + LONG APIENTRY UserChangeDisplaySettings( @@ -774,6 +786,8 @@ goto leave; } + UserUpdateFullscreen(flags); + /* Update the system metrics */ InitMetrics(); @@ -809,6 +823,19 @@ return lResult; } +VOID +APIENTRY +UserDisplayNotifyShutdown( + PPROCESSINFO ppiCurrent) +{ + if (ppiCurrent == gpFullscreen) + { + UserChangeDisplaySettings(NULL, NULL, 0, NULL); + if (gpFullscreen) + ERR("Failed to restore display mode!\n"); + } +} + LONG APIENTRY NtUserChangeDisplaySettings( Index: reactos/win32ss/user/ntuser/main.c =================================================================== --- reactos/win32ss/user/ntuser/main.c (revision 71501) +++ reactos/win32ss/user/ntuser/main.c (working copy) @@ -677,6 +677,10 @@ return Status; } +VOID +APIENTRY +UserDisplayNotifyShutdown(PPROCESSINFO ppiCurrent); + NTSTATUS NTAPI ExitThreadCallback(PETHREAD Thread) @@ -806,6 +810,11 @@ gptiForeground = NULL; } + /* Restore display mode when we are the last thread, and we changed it */ + if (ppiCurrent->cThreads == 0) + UserDisplayNotifyShutdown(ppiCurrent); + + // Fixes CORE-6384 & CORE-7030. /* if (ptiLastInput == ptiCurrent) {