summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/window.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-03-12 01:15:08 +1100
committer Vas Crabb <vas@vastheman.com>2021-03-12 01:15:08 +1100
commit4cf96da22c09651c1da2b27ee61028d558e7af49 (patch)
tree4482cdc706be33b29d050fb8b0f84c457ba20ba9 /src/osd/windows/window.cpp
parentb38a77bca54c007f995b9bb47687354d154b6be5 (diff)
-A few incremental UI code improvements:
* Simplified message when toggling UI controls. * Show actual configured UI toggle key, not misleading hard-coded text. * Push window activated/deactivated events to UI manager. * Simplified SDL window event handling code - events are pretty precise. -Miscellaneous code cleanup.
Diffstat (limited to 'src/osd/windows/window.cpp')
-rw-r--r--src/osd/windows/window.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index 75090e0548f..cc9ff4484ba 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -921,9 +921,10 @@ void winwindow_ui_pause(running_machine &machine, int pause)
assert(GetCurrentThreadId() == main_threadid);
- // if we're pausing, increment the pause counter
if (pause)
{
+ // if we're pausing, increment the pause counter
+
// if we're the first to pause, we have to actually initiate it
if (ui_temp_pause++ == 0)
{
@@ -935,10 +936,10 @@ void winwindow_ui_pause(running_machine &machine, int pause)
SetEvent(ui_pause_event);
}
}
-
- // if we're resuming, decrement the pause counter
else
{
+ // if we're resuming, decrement the pause counter
+
// if we're the last to resume, unpause MAME
if (--ui_temp_pause == 0)
{
@@ -1273,18 +1274,26 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
return DefWindowProc(wnd, message, wparam, lparam);
case WM_ACTIVATE:
- if (window->has_renderer() && window->fullscreen())
+ if (window->has_renderer())
{
- if ((wparam == WA_ACTIVE) || (wparam == WA_CLICKACTIVE))
- {
- for (const auto &w : osd_common_t::s_window_list)
- ShowWindow(std::static_pointer_cast<win_window_info>(w)->platform_window(), SW_RESTORE);
- }
- else if ((wparam == WA_INACTIVE) && !is_mame_window(HWND(lparam)))
+ if (window->fullscreen())
{
- for (const auto &w : osd_common_t::s_window_list)
- ShowWindow(std::static_pointer_cast<win_window_info>(w)->platform_window(), SW_MINIMIZE);
+ if ((wparam == WA_ACTIVE) || (wparam == WA_CLICKACTIVE))
+ {
+ for (const auto &w : osd_common_t::s_window_list)
+ ShowWindow(std::static_pointer_cast<win_window_info>(w)->platform_window(), SW_RESTORE);
+ }
+ else if ((wparam == WA_INACTIVE) && !is_mame_window(HWND(lparam)))
+ {
+ for (const auto &w : osd_common_t::s_window_list)
+ ShowWindow(std::static_pointer_cast<win_window_info>(w)->platform_window(), SW_MINIMIZE);
+ }
}
+
+ if ((wparam == WA_ACTIVE) || (wparam == WA_CLICKACTIVE))
+ window->machine().ui_input().push_window_focus_event(window->target());
+ else if (wparam == WA_INACTIVE)
+ window->machine().ui_input().push_window_defocus_event(window->target());
}
return DefWindowProc(wnd, message, wparam, lparam);