From 56c9a5195e48d3d88ea5637ca3dcb236d9f0dd1f Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Fri, 6 Sep 2019 23:19:44 +0900 Subject: [PATCH] v109 Keep focus on the panel list when changing settings / tools panels. Fixed Windows combo box flickering when changing panels. Suppress Alt+F4 on Windows in fullscreen mode. --- bsnes/emulator/emulator.hpp | 4 ++-- bsnes/target-bsnes/bsnes.cpp | 2 +- bsnes/target-bsnes/settings/settings.cpp | 1 + bsnes/target-bsnes/tools/tools.cpp | 1 + hiro/windows/widget/combo-button.cpp | 6 ++---- ruby/video/direct3d.cpp | 1 + ruby/video/directdraw.cpp | 1 + ruby/video/gdi.cpp | 1 + ruby/video/wgl.cpp | 1 + 9 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index 218ac639..0b525188 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -29,13 +29,13 @@ using namespace nall; namespace Emulator { static const string Name = "bsnes"; - static const string Version = "108.17"; + static const string Version = "109"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org"; //incremented only when serialization format changes - static const string SerializerVersion = "108.4"; + static const string SerializerVersion = "109"; namespace Constants { namespace Colorburst { diff --git a/bsnes/target-bsnes/bsnes.cpp b/bsnes/target-bsnes/bsnes.cpp index 1f99bc6b..8da45ed5 100644 --- a/bsnes/target-bsnes/bsnes.cpp +++ b/bsnes/target-bsnes/bsnes.cpp @@ -4,7 +4,7 @@ Video video; Audio audio; Input input; unique_pointer emulator; -// + auto locate(string name) -> string { string location = {Path::program(), name}; if(inode::exists(location)) return location; diff --git a/bsnes/target-bsnes/settings/settings.cpp b/bsnes/target-bsnes/settings/settings.cpp index 47c21802..e7651505 100644 --- a/bsnes/target-bsnes/settings/settings.cpp +++ b/bsnes/target-bsnes/settings/settings.cpp @@ -245,4 +245,5 @@ auto SettingsWindow::show(int index) -> void { panelContainer.resize(); setVisible(); setFocused(); + panelList.setFocused(); } diff --git a/bsnes/target-bsnes/tools/tools.cpp b/bsnes/target-bsnes/tools/tools.cpp index 7f74ae89..e48161fe 100644 --- a/bsnes/target-bsnes/tools/tools.cpp +++ b/bsnes/target-bsnes/tools/tools.cpp @@ -99,4 +99,5 @@ auto ToolsWindow::show(int index) -> void { panelContainer.resize(); setVisible(); setFocused(); + panelList.setFocused(); } diff --git a/hiro/windows/widget/combo-button.cpp b/hiro/windows/widget/combo-button.cpp index 0441540e..65ef68d4 100755 --- a/hiro/windows/widget/combo-button.cpp +++ b/hiro/windows/widget/combo-button.cpp @@ -45,12 +45,10 @@ auto pComboButton::reset() -> void { } auto pComboButton::setGeometry(Geometry geometry) -> void { - //height = minimum drop-down list height; use CB_SETITEMHEIGHT to control actual widget height - pWidget::setGeometry({geometry.x(), geometry.y(), geometry.width(), 1}); RECT rc; GetWindowRect(hwnd, &rc); - unsigned adjustedHeight = geometry.height() - ((rc.bottom - rc.top) - SendMessage(hwnd, CB_GETITEMHEIGHT, (WPARAM)-1, 0)); - SendMessage(hwnd, CB_SETITEMHEIGHT, (WPARAM)-1, adjustedHeight); + geometry.setY(geometry.y() + (geometry.height() - (rc.bottom - rc.top))); + pWidget::setGeometry({geometry.x(), geometry.y(), geometry.width(), 1}); } auto pComboButton::onChange() -> void { diff --git a/ruby/video/direct3d.cpp b/ruby/video/direct3d.cpp index 52836583..905fb161 100755 --- a/ruby/video/direct3d.cpp +++ b/ruby/video/direct3d.cpp @@ -4,6 +4,7 @@ #undef interface static LRESULT CALLBACK VideoDirect3D9_WindowProcedure(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { + if(msg == WM_SYSKEYDOWN && waram == VK_F4) return false; return DefWindowProc(hwnd, msg, wparam, lparam); } diff --git a/ruby/video/directdraw.cpp b/ruby/video/directdraw.cpp index fdd73c72..7b6aeff5 100755 --- a/ruby/video/directdraw.cpp +++ b/ruby/video/directdraw.cpp @@ -2,6 +2,7 @@ #undef interface static LRESULT CALLBACK VideoDirectDraw7_WindowProcedure(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { + if(msg == WM_SYSKEYDOWN && waram == VK_F4) return false; return DefWindowProc(hwnd, msg, wparam, lparam); } diff --git a/ruby/video/gdi.cpp b/ruby/video/gdi.cpp index 1c8fb9c0..7d935d37 100755 --- a/ruby/video/gdi.cpp +++ b/ruby/video/gdi.cpp @@ -1,4 +1,5 @@ static LRESULT CALLBACK VideoGDI_WindowProcedure(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { + if(msg == WM_SYSKEYDOWN && waram == VK_F4) return false; return DefWindowProc(hwnd, msg, wparam, lparam); } diff --git a/ruby/video/wgl.cpp b/ruby/video/wgl.cpp index 41daec1c..01982382 100755 --- a/ruby/video/wgl.cpp +++ b/ruby/video/wgl.cpp @@ -4,6 +4,7 @@ #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 static LRESULT CALLBACK VideoOpenGL32_WindowProcedure(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { + if(msg == WM_SYSKEYDOWN && waram == VK_F4) return false; return DefWindowProc(hwnd, msg, wparam, lparam); }