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:
parent
c8723e171b
commit
34c5c28cec
@ -13,6 +13,7 @@ namespace
|
|||||||
HANDLE g_presentationWindowThread = nullptr;
|
HANDLE g_presentationWindowThread = nullptr;
|
||||||
unsigned g_presentationWindowThreadId = 0;
|
unsigned g_presentationWindowThreadId = 0;
|
||||||
HWND g_messageWindow = nullptr;
|
HWND g_messageWindow = nullptr;
|
||||||
|
bool g_isThreadReady = false;
|
||||||
|
|
||||||
LRESULT CALLBACK messageWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK messageWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
@ -97,6 +98,7 @@ namespace
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_isThreadReady = true;
|
||||||
Gdi::WinProc::installHooks();
|
Gdi::WinProc::installHooks();
|
||||||
Compat::closeDbgEng();
|
Compat::closeDbgEng();
|
||||||
|
|
||||||
@ -150,6 +152,11 @@ namespace Gdi
|
|||||||
return GetWindowThreadProcessId(hwnd, nullptr) == g_presentationWindowThreadId;
|
return GetWindowThreadProcessId(hwnd, nullptr) == g_presentationWindowThreadId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isThreadReady()
|
||||||
|
{
|
||||||
|
return g_isThreadReady;
|
||||||
|
}
|
||||||
|
|
||||||
void setWindowPos(HWND hwnd, const WINDOWPOS& wp)
|
void setWindowPos(HWND hwnd, const WINDOWPOS& wp)
|
||||||
{
|
{
|
||||||
sendMessageBlocking(hwnd, WM_SETPRESENTATIONWINDOWPOS, 0, reinterpret_cast<WPARAM>(&wp));
|
sendMessageBlocking(hwnd, WM_SETPRESENTATIONWINDOWPOS, 0, reinterpret_cast<WPARAM>(&wp));
|
||||||
|
@ -9,6 +9,7 @@ namespace Gdi
|
|||||||
HWND create(HWND owner);
|
HWND create(HWND owner);
|
||||||
void destroy(HWND hwnd);
|
void destroy(HWND hwnd);
|
||||||
bool isPresentationWindow(HWND hwnd);
|
bool isPresentationWindow(HWND hwnd);
|
||||||
|
bool isThreadReady();
|
||||||
void setWindowPos(HWND hwnd, const WINDOWPOS& wp);
|
void setWindowPos(HWND hwnd, const WINDOWPOS& wp);
|
||||||
void setWindowRgn(HWND hwnd, HRGN rgn);
|
void setWindowRgn(HWND hwnd, HRGN rgn);
|
||||||
void startThread();
|
void startThread();
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <Gdi/Gdi.h>
|
#include <Gdi/Gdi.h>
|
||||||
#include <Gdi/Region.h>
|
#include <Gdi/Region.h>
|
||||||
#include <Gdi/VirtualScreen.h>
|
#include <Gdi/VirtualScreen.h>
|
||||||
|
#include <Gdi/Window.h>
|
||||||
#include <Win32/DisplayMode.h>
|
#include <Win32/DisplayMode.h>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@ -275,6 +276,7 @@ namespace Gdi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gdi::Window::updateAll();
|
||||||
Gdi::redraw(nullptr);
|
Gdi::redraw(nullptr);
|
||||||
return LOG_RESULT(true);
|
return LOG_RESULT(true);
|
||||||
}
|
}
|
||||||
|
@ -512,6 +512,11 @@ namespace Gdi
|
|||||||
void updateAll()
|
void updateAll()
|
||||||
{
|
{
|
||||||
LOG_FUNC("Window::updateAll");
|
LOG_FUNC("Window::updateAll");
|
||||||
|
if (!Gdi::PresentationWindow::isThreadReady())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateWindowContext context;
|
UpdateWindowContext context;
|
||||||
context.processId = GetCurrentProcessId();
|
context.processId = GetCurrentProcessId();
|
||||||
context.virtualScreenRegion = VirtualScreen::getRegion();
|
context.virtualScreenRegion = VirtualScreen::getRegion();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user