Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect size of opengl viewport #11745

Closed
jonjenssen opened this issue Oct 3, 2024 · 3 comments · Fixed by #11883
Closed

Incorrect size of opengl viewport #11745

jonjenssen opened this issue Oct 3, 2024 · 3 comments · Fixed by #11883
Assignees
Labels
Bug Bug not yet in an official release PendingRelease Issues is fixed and will be available in next release

Comments

@jonjenssen
Copy link
Collaborator

On Windows, if you have another DPI scaling than 100%, the opengl viewport gets wrong size.

@jonjenssen jonjenssen added the Bug Bug not yet in an official release label Oct 3, 2024
@jonjenssen jonjenssen self-assigned this Oct 3, 2024
@jonjenssen
Copy link
Collaborator Author

Need to scale raw coordinates in caf::Viewer, both for output and mouse input, like:

void RiuViewer::resizeGL( int width, int height )
{
    auto ratio = RiaGuiApplication::instance()->primaryScreen()->devicePixelRatio();
    caf::Viewer::resizeGL( width * ratio, height * ratio );
}

@jonjenssen
Copy link
Collaborator Author

jonjenssen commented Oct 3, 2024

Temporary fix to revert to Qt5 behaviour on Windows:

RiaMain.cpp:

#ifdef WIN32
    // Temporary workaround for incorrect scaling of opengl viewport on windows with dpi scaling != 100%
    // Reverts scaling behaviour to Qt5 style
    // Should be replaced by proper scaling of x and y coordinates in caf::Viewer
    qputenv( "QT_ENABLE_HIGHDPI_SCALING", "0" );
#endif

(Setting env variable before running executable gives mixed results)

@magnesj
Copy link
Member

magnesj commented Nov 15, 2024

Maybe related to #11889

@github-actions github-actions bot added the PendingRelease Issues is fixed and will be available in next release label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug not yet in an official release PendingRelease Issues is fixed and will be available in next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants