Skip to content

How to correctly handle external UI with scale factor #428

@AnClark

Description

@AnClark

Hi, FalkTX!

I've migrated rncbc's synthv1 to DPF. It has a Qt-based UI. But it doesn't behave well on Windows 10, with 125% scale factor.

Just like this screenshot describes, REAPER's host window size is still at 100% scale factor, so the UI cannot be fully shown. All of VST2, VST3 and CLAP have this issue.

image

I've tried to set host window size on UI constructor, but in vain. Window size is still untouched:

  • Call UI::setWidth() and UI::setHeight()
  • Use Win32 API SetWindowPos(): SetWindowPos((HWND)getParentWindowHandle(), HWND_TOP, 0, 0, 1800, 1000, SWP_NOMOVE);
  • Use QWindow::fromWinId() to get parent window's QWindow instance, then call setWidth() and setHeight()

I've also tried modifying DISTRHO_UI_DEFAULT_WIDTH and DISTRHO_UI_DEFAULT_HEIGHT, but they are not flexible with different scale factors.

So how can I solve this?


What's more, setGeometryConstraints(), and DISTRHO::UI constructor param automaticallyScaleAndSetAsMinimumSize do not work with external UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions