1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Update window visible regions during VirtualScreen::update

This commit is contained in:
narzoul 2021-04-06 11:51:40 +02:00
parent c8723e171b
commit 34c5c28cec
4 changed files with 15 additions and 0 deletions

View File

@ -13,6 +13,7 @@ namespace
HANDLE g_presentationWindowThread = nullptr;
unsigned g_presentationWindowThreadId = 0;
HWND g_messageWindow = nullptr;
bool g_isThreadReady = false;
LRESULT CALLBACK messageWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@ -97,6 +98,7 @@ namespace
return 0;
}
g_isThreadReady = true;
Gdi::WinProc::installHooks();
Compat::closeDbgEng();
@ -150,6 +152,11 @@ namespace Gdi
return GetWindowThreadProcessId(hwnd, nullptr) == g_presentationWindowThreadId;
}
bool isThreadReady()
{
return g_isThreadReady;
}
void setWindowPos(HWND hwnd, const WINDOWPOS& wp)
{
sendMessageBlocking(hwnd, WM_SETPRESENTATIONWINDOWPOS, 0, reinterpret_cast<WPARAM>(&wp));

View File

@ -9,6 +9,7 @@ namespace Gdi
HWND create(HWND owner);
void destroy(HWND hwnd);
bool isPresentationWindow(HWND hwnd);
bool isThreadReady();
void setWindowPos(HWND hwnd, const WINDOWPOS& wp);
void setWindowRgn(HWND hwnd, HRGN rgn);
void startThread();

View File

@ -11,6 +11,7 @@
#include <Gdi/Gdi.h>
#include <Gdi/Region.h>
#include <Gdi/VirtualScreen.h>
#include <Gdi/Window.h>
#include <Win32/DisplayMode.h>
namespace
@ -275,6 +276,7 @@ namespace Gdi
}
}
Gdi::Window::updateAll();
Gdi::redraw(nullptr);
return LOG_RESULT(true);
}

View File

@ -512,6 +512,11 @@ namespace Gdi
void updateAll()
{
LOG_FUNC("Window::updateAll");
if (!Gdi::PresentationWindow::isThreadReady())
{
return;
}
UpdateWindowContext context;
context.processId = GetCurrentProcessId();
context.virtualScreenRegion = VirtualScreen::getRegion();