mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 14:39:01 +01:00
Merge pull request #8298 from CookiePLMonster/win-updater-hide-fix
WinUpdater: Properly hide window on startup as intended
This commit is contained in:
commit
ec1fe41eb2
@ -12,6 +12,8 @@
|
|||||||
#include <ShObjIdl.h>
|
#include <ShObjIdl.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
|
|
||||||
|
#include "Common/Event.h"
|
||||||
|
#include "Common/ScopeGuard.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@ -23,6 +25,7 @@ HWND current_progressbar_handle = nullptr;
|
|||||||
ITaskbarList3* taskbar_list = nullptr;
|
ITaskbarList3* taskbar_list = nullptr;
|
||||||
|
|
||||||
std::thread ui_thread;
|
std::thread ui_thread;
|
||||||
|
Common::Event window_created_event;
|
||||||
|
|
||||||
int GetWindowHeight(HWND hwnd)
|
int GetWindowHeight(HWND hwnd)
|
||||||
{
|
{
|
||||||
@ -45,7 +48,7 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
}; // namespace
|
}; // namespace
|
||||||
|
|
||||||
constexpr int PROGRESSBAR_FLAGS = WS_VISIBLE | WS_CHILD | PBS_SMOOTH | PBS_SMOOTHREVERSE;
|
constexpr int PROGRESSBAR_FLAGS = WS_VISIBLE | WS_CHILD | PBS_SMOOTH | PBS_SMOOTHREVERSE;
|
||||||
constexpr int WINDOW_FLAGS = WS_VISIBLE | WS_CLIPCHILDREN;
|
constexpr int WINDOW_FLAGS = WS_CLIPCHILDREN;
|
||||||
constexpr int PADDING_HEIGHT = 5;
|
constexpr int PADDING_HEIGHT = 5;
|
||||||
|
|
||||||
namespace UI
|
namespace UI
|
||||||
@ -54,6 +57,9 @@ bool InitWindow()
|
|||||||
{
|
{
|
||||||
InitCommonControls();
|
InitCommonControls();
|
||||||
|
|
||||||
|
// Notify main thread we're done creating the window when we return
|
||||||
|
Common::ScopeGuard ui_guard{[] { window_created_event.Set(); }};
|
||||||
|
|
||||||
WNDCLASS wndcl = {};
|
WNDCLASS wndcl = {};
|
||||||
wndcl.lpfnWndProc = WindowProc;
|
wndcl.lpfnWndProc = WindowProc;
|
||||||
wndcl.hbrBackground = GetSysColorBrush(COLOR_MENU);
|
wndcl.hbrBackground = GetSysColorBrush(COLOR_MENU);
|
||||||
@ -226,6 +232,9 @@ void MessageLoop()
|
|||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
ui_thread = std::thread(MessageLoop);
|
ui_thread = std::thread(MessageLoop);
|
||||||
|
|
||||||
|
// Wait for UI thread to finish creating the window (or at least attempting to)
|
||||||
|
window_created_event.Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stop()
|
void Stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user