@@ -180,7 +180,7 @@ PluginWindow& UI::PrivateData::createNextWindow(UI* const ui, uint width, uint h
180180 UI::PrivateData* const uiData = s_nextPrivateData;
181181 const double scaleFactor = d_isNotZero (uiData->scaleFactor ) ? uiData->scaleFactor : getDesktopScaleFactor (uiData->winId );
182182
183- if (d_isNotZero (scaleFactor) && d_isNotEqual (scaleFactor, 1.0 ))
183+ if (d_isNotEqual (scaleFactor, 1.0 ))
184184 {
185185 width *= scaleFactor;
186186 height *= scaleFactor;
@@ -322,7 +322,7 @@ void UI::PrivateData::webViewMessageCallback(void* const arg, char* const msg)
322322/* ------------------------------------------------------------------------------------------------------------
323323 * UI */
324324
325- UI::UI (const uint width, const uint height)
325+ UI::UI (const uint width, const uint height, const InternalScalingMode internalScalingMode )
326326 : UIWidget(UI::PrivateData::createNextWindow(this ,
327327 // width
328328 #ifdef DISTRHO_UI_DEFAULT_WIDTH
@@ -339,14 +339,15 @@ UI::UI(const uint width, const uint height)
339339{
340340 if (width != 0 && height != 0 )
341341 {
342- Widget::setSize (width, height);
343- }
344- # ifdef DISTRHO_UI_DEFAULT_WIDTH
345- else
346- {
347- Widget::setSize (DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT);
342+ if (internalScalingMode == kInternalScalingMatchingHost )
343+ {
344+ d_stdout ( " enableInternalScalingWithSize %u %u " , width, height);
345+ getWindow (). enableInternalScalingWithSize (width, height, true );
346+ return ;
347+ }
348348 }
349- #endif
349+
350+ Widget::setSize (getWindow ().getSize ());
350351}
351352
352353#if DGL_ALLOW_DEPRECATED_METHODS
0 commit comments