@@ -1726,22 +1726,29 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode,
17261726#endif
17271727
17281728 case audioMasterSizeWindow:
1729+ {
17291730 SHOW_CALLBACK ( " amc: audioMasterSizeWindow\n " );
17301731 if ( __plugin->m_window == 0 )
17311732 {
17321733 return 0 ;
17331734 }
17341735 __plugin->m_windowWidth = _index;
17351736 __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 ,
17381744 SWP_NOACTIVATE | SWP_NOMOVE |
17391745 SWP_NOOWNERZORDER | SWP_NOZORDER );
17401746 __plugin->sendMessage (
17411747 message ( IdVstPluginEditorGeometry ).
17421748 addInt ( __plugin->m_windowWidth ).
17431749 addInt ( __plugin->m_windowHeight ) );
17441750 return 1 ;
1751+ }
17451752
17461753 case audioMasterGetSampleRate:
17471754 SHOW_CALLBACK ( " amc: audioMasterGetSampleRate\n " );
0 commit comments