summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/win/debugbaseinfo.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-01-30 22:46:43 +1100
committer Vas Crabb <vas@vastheman.com>2021-01-30 22:46:43 +1100
commit8d04ca7d7d307ca8f85624c571ccfd4eb23a26e0 (patch)
treea0bca1a22f519b9628c4c13efb339e834ec41295 /src/osd/modules/debugger/win/debugbaseinfo.cpp
parentfd3ca4668a6215f6821263742ac86a265f93c56e (diff)
Debuger updates:
* Improved behaviour of bottom line in Qt and win32 debugger views. * Ported memory tracking feature from Qt to win32 module.
Diffstat (limited to 'src/osd/modules/debugger/win/debugbaseinfo.cpp')
-rw-r--r--src/osd/modules/debugger/win/debugbaseinfo.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/osd/modules/debugger/win/debugbaseinfo.cpp b/src/osd/modules/debugger/win/debugbaseinfo.cpp
index 4914d54cfad..1be4f892da7 100644
--- a/src/osd/modules/debugger/win/debugbaseinfo.cpp
+++ b/src/osd/modules/debugger/win/debugbaseinfo.cpp
@@ -21,12 +21,10 @@ debugbase_info::debugbase_info(debugger_windows_interface &debugger) :
void debugbase_info::smart_set_window_bounds(HWND wnd, HWND parent, RECT const &bounds)
{
- RECT curbounds;
- int flags = 0;
-
// first get the current bounds, relative to the parent
+ RECT curbounds;
GetWindowRect(wnd, &curbounds);
- if (parent != nullptr)
+ if (parent)
{
RECT parentbounds;
GetWindowRect(parent, &parentbounds);
@@ -37,6 +35,7 @@ void debugbase_info::smart_set_window_bounds(HWND wnd, HWND parent, RECT const &
}
// if the position matches, don't change it
+ int flags = 0;
if (curbounds.top == bounds.top && curbounds.left == bounds.left)
flags |= SWP_NOMOVE;
if ((curbounds.bottom - curbounds.top) == (bounds.bottom - bounds.top) &&
@@ -45,17 +44,19 @@ void debugbase_info::smart_set_window_bounds(HWND wnd, HWND parent, RECT const &
// if we need to, reposition the window
if (flags != (SWP_NOMOVE | SWP_NOSIZE))
- SetWindowPos(wnd, nullptr,
- bounds.left, bounds.top,
- bounds.right - bounds.left, bounds.bottom - bounds.top,
- SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | flags);
+ {
+ SetWindowPos(
+ wnd, nullptr,
+ bounds.left, bounds.top,
+ bounds.right - bounds.left, bounds.bottom - bounds.top,
+ SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | flags);
+ }
}
-
void debugbase_info::smart_show_window(HWND wnd, bool show)
{
- BOOL const visible = IsWindowVisible(wnd);
- if ((visible && !show) || (!visible && show))
+ bool const visible = bool(IsWindowVisible(wnd));
+ if (visible != show)
ShowWindow(wnd, show ? SW_SHOW : SW_HIDE);
}