1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 16:32:33 +02:00

Fix window flash on startup

This commit is contained in:
Elias Steurer 2020-06-21 16:10:56 +02:00
parent f7a78448e5
commit 6d4afb5b62

View File

@ -80,12 +80,13 @@ WinWindow::WinWindow(
: BaseWindow(projectPath, activeScreensList, checkWallpaperVisible)
{
m_window.hide();
m_windowHandle = reinterpret_cast<HWND>(m_window.winId());
if (!IsWindow(m_windowHandle)) {
qFatal("Could not get a valid window handle!");
}
ShowWindow(m_windowHandleWorker, SW_HIDE);
setAppID(id);
bool ok = false;
@ -181,7 +182,8 @@ void WinWindow::setupWallpaperForOneScreen(int activeScreen)
{
QScreen* screen = QApplication::screens().at(activeScreen);
QRect screenRect = screen->geometry();
if (!SetWindowPos(m_windowHandle, nullptr, screenRect.x() + m_windowOffsetX - 1, screenRect.y() + m_windowOffsetY - 1, screenRect.width() + 2, screenRect.height() + 2, SWP_SHOWWINDOW)) {
if (!SetWindowPos(m_windowHandle, nullptr, screenRect.x() + m_windowOffsetX - 1, screenRect.y() + m_windowOffsetY - 1, screenRect.width() + 2, screenRect.height() + 2, SWP_HIDEWINDOW)) {
qFatal("Could not set window pos: ");
}
if (SetParent(m_windowHandle, m_windowHandleWorker) == nullptr) {