Skip to content

Commit

Permalink
Merge pull request #2241 from skidau/hwnd-hotkey
Browse files Browse the repository at this point in the history
Updated the hwnd for hotkeys.
  • Loading branch information
skidau committed Mar 22, 2015
2 parents d3ccad4 + 482ef96 commit e08762d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Source/Core/Core/Core.cpp
Expand Up @@ -26,6 +26,7 @@
#include "Core/CoreTiming.h"
#include "Core/DSPEmulator.h"
#include "Core/Host.h"
#include "Core/HotkeyManager.h"
#include "Core/MemTools.h"
#include "Core/Movie.h"
#include "Core/NetPlayProto.h"
Expand Down Expand Up @@ -96,6 +97,7 @@ static bool s_is_stopping = false;
static bool s_hardware_initialized = false;
static bool s_is_started = false;
static void* s_window_handle = nullptr;
static bool s_window_handle_changed = false;
static std::string s_state_filename;
static std::thread s_emu_thread;
static StoppedCallbackFunc s_on_stopped_callback = nullptr;
Expand Down Expand Up @@ -228,7 +230,12 @@ bool Init()
!!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
}

s_window_handle = Host_GetRenderHandle();
s_window_handle_changed = false;
if (s_window_handle != Host_GetRenderHandle())
{
s_window_handle = Host_GetRenderHandle();
s_window_handle_changed = true;
}

// Start the emu thread
s_emu_thread = std::thread(EmuThread);
Expand Down Expand Up @@ -430,7 +437,11 @@ void EmuThread()
else
{
// Update references in case controllers were refreshed
g_controller_interface.Initialize(s_window_handle);
if (s_window_handle_changed)
{
g_controller_interface.Initialize(s_window_handle);
HotkeyManagerEmu::LoadConfig();
}
Pad::LoadConfig();
Keyboard::LoadConfig();
}
Expand Down

0 comments on commit e08762d

Please sign in to comment.