summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-01-21 23:33:53 +1100
committer Vas Crabb <vas@vastheman.com>2021-01-21 23:33:53 +1100
commit7cfe419ca809eb8572f5a0c1e85e8170342c028e (patch)
treec64b2e2230ff7b23fe9122bf74096ddef3420c00 /src/osd/windows
parentef82fd102d548e70aa73e3ba189a6e2d5464b405 (diff)
-osd/windows: Minimise full-screen windows on losing focus (#2997).
-osd/modules/osdwindow.cpp: Clean up window title formatting. * Show data type model in window title. * Moved window title formatting to a single place. -tools/chdman.cpp: Removed some unnecessary .c_str() calls.
Diffstat (limited to 'src/osd/windows')
-rw-r--r--src/osd/windows/window.cpp25
-rw-r--r--src/osd/windows/window.h1
2 files changed, 17 insertions, 9 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index 8a431d33f5f..75090e0548f 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -314,7 +314,6 @@ win_window_info::win_window_info(
, m_lastclicky(0)
, m_attached_mode(false)
{
- memset(m_title,0,sizeof(m_title));
m_non_fullscreen_bounds.left = 0;
m_non_fullscreen_bounds.top = 0;
m_non_fullscreen_bounds.right = 0;
@@ -779,12 +778,6 @@ void win_window_info::create(running_machine &machine, int index, std::shared_pt
window->m_targetlayerconfig = window->target()->layer_config();
window->m_targetvismask = window->target()->visibility_mask();
- // make the window title
- if (video_config.numscreens == 1)
- sprintf(window->m_title, "%s: %s [%s]", emulator_info::get_appname(), machine.system().type.fullname(), machine.system().name);
- else
- sprintf(window->m_title, "%s: %s [%s] - Screen %d", emulator_info::get_appname(), machine.system().type.fullname(), machine.system().name, index);
-
// set the initial maximized state
window->m_startmaximized = downcast<windows_options &>(machine.options()).maximize();
@@ -1046,7 +1039,7 @@ int win_window_info::complete_create()
hwnd = win_create_window_ex_utf8(
fullscreen() ? FULLSCREEN_STYLE_EX : WINDOW_STYLE_EX,
"MAME",
- m_title,
+ title().c_str(),
fullscreen() ? FULLSCREEN_STYLE : WINDOW_STYLE,
monitorbounds.left() + 20, monitorbounds.top() + 20,
monitorbounds.left() + 100, monitorbounds.top() + 100,
@@ -1279,6 +1272,22 @@ 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 ((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);
+ }
+ }
+ return DefWindowProc(wnd, message, wparam, lparam);
+
// close: cause MAME to exit
case WM_CLOSE:
window->machine().schedule_exit();
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index 3a02ae87277..71bd519ab3a 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -100,7 +100,6 @@ public:
volatile int m_init_state;
// window handle and info
- char m_title[256];
RECT m_non_fullscreen_bounds;
int m_startmaximized;
int m_isminimized;