mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[WIN32SS] Remember the last process that changed the displaymode with CDS_FULLSCREEN, restore mode after it quits. CORE-11358 #resolve
svn path=/trunk/; revision=71529
This commit is contained in:
@@ -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,16 @@ NtUserEnumDisplaySettings(
|
||||
return Status;
|
||||
}
|
||||
|
||||
VOID
|
||||
UserUpdateFullscreen(
|
||||
DWORD flags)
|
||||
{
|
||||
if (flags & CDS_FULLSCREEN)
|
||||
gpFullscreen = gptiCurrent->ppi;
|
||||
else
|
||||
gpFullscreen = NULL;
|
||||
}
|
||||
|
||||
LONG
|
||||
APIENTRY
|
||||
UserChangeDisplaySettings(
|
||||
@@ -774,6 +785,8 @@ UserChangeDisplaySettings(
|
||||
goto leave;
|
||||
}
|
||||
|
||||
UserUpdateFullscreen(flags);
|
||||
|
||||
/* Update the system metrics */
|
||||
InitMetrics();
|
||||
|
||||
@@ -809,6 +822,18 @@ leave:
|
||||
return lResult;
|
||||
}
|
||||
|
||||
VOID
|
||||
UserDisplayNotifyShutdown(
|
||||
PPROCESSINFO ppiCurrent)
|
||||
{
|
||||
if (ppiCurrent == gpFullscreen)
|
||||
{
|
||||
UserChangeDisplaySettings(NULL, NULL, 0, NULL);
|
||||
if (gpFullscreen)
|
||||
ERR("Failed to restore display mode!\n");
|
||||
}
|
||||
}
|
||||
|
||||
LONG
|
||||
APIENTRY
|
||||
NtUserChangeDisplaySettings(
|
||||
|
||||
@@ -677,6 +677,9 @@ error:
|
||||
return Status;
|
||||
}
|
||||
|
||||
VOID
|
||||
UserDisplayNotifyShutdown(PPROCESSINFO ppiCurrent);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
ExitThreadCallback(PETHREAD Thread)
|
||||
@@ -806,6 +809,11 @@ ExitThreadCallback(PETHREAD Thread)
|
||||
gptiForeground = NULL;
|
||||
}
|
||||
|
||||
/* Restore display mode when we are the last thread, and we changed the display mode */
|
||||
if (ppiCurrent->cThreads == 0)
|
||||
UserDisplayNotifyShutdown(ppiCurrent);
|
||||
|
||||
|
||||
// Fixes CORE-6384 & CORE-7030.
|
||||
/* if (ptiLastInput == ptiCurrent)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user