@@ -1726,22 +1726,29 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode,
1726
1726
#endif
1727
1727
1728
1728
case audioMasterSizeWindow:
1729
+ {
1729
1730
SHOW_CALLBACK ( " amc: audioMasterSizeWindow\n " );
1730
1731
if ( __plugin->m_window == 0 )
1731
1732
{
1732
1733
return 0 ;
1733
1734
}
1734
1735
__plugin->m_windowWidth = _index;
1735
1736
__plugin->m_windowHeight = _value;
1736
- SetWindowPos ( __plugin->m_window , 0 , 0 , 0 ,
1737
- _index + 8 , _value + 26 ,
1737
+ HWND window = __plugin->m_window ;
1738
+ DWORD dwStyle = GetWindowLongPtr ( window, GWL_STYLE );
1739
+ RECT windowSize = { 0 , 0 , (int ) _index, (int ) _value };
1740
+ AdjustWindowRect ( &windowSize, dwStyle, false );
1741
+ SetWindowPos ( window, 0 , 0 , 0 ,
1742
+ windowSize.right - windowSize.left ,
1743
+ windowSize.bottom - windowSize.top ,
1738
1744
SWP_NOACTIVATE | SWP_NOMOVE |
1739
1745
SWP_NOOWNERZORDER | SWP_NOZORDER );
1740
1746
__plugin->sendMessage (
1741
1747
message ( IdVstPluginEditorGeometry ).
1742
1748
addInt ( __plugin->m_windowWidth ).
1743
1749
addInt ( __plugin->m_windowHeight ) );
1744
1750
return 1 ;
1751
+ }
1745
1752
1746
1753
case audioMasterGetSampleRate:
1747
1754
SHOW_CALLBACK ( " amc: audioMasterGetSampleRate\n " );
0 commit comments