-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Qt/macOS: enable HiDPI ( retina display ) support #12552
Conversation
emugl->resizeGL(emugl->size().width(), emugl->size().height()); | ||
// TODO: Won't showFullScreen do this for us? | ||
setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); | ||
setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that resizing the main window will trigger resizeGL automatically. This code should be unnecessary on Windows too.
activateWindow(); | ||
} | ||
|
||
void MainWindow::SetFullScreen(bool fullscreen) { | ||
if (fullscreen) { | ||
#if !PPSSPP_PLATFORM(MAC) | ||
menuBar()->hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qt uses native menubar on macOS by default, which is hidden automatically on fullscreen.
g_dpi = (float)System_GetPropertyInt(SYSPROP_DISPLAY_DPI); | ||
float g_logical_dpi = (float)System_GetPropertyInt(SYSPROP_DISPLAY_LOGICAL_DPI); | ||
g_dpi_scale_x = g_logical_dpi / g_dpi; | ||
g_dpi_scale_y = g_logical_dpi / g_dpi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tries to get the native scale factor. This should work on Windows too ( untested )
d2d6364
to
d570049
Compare
Just out of curiosity, how did u manage to get ppsspp 1.9.3 working on your mac? |
I built it from source
Just use OpenGL |
I just dig HiDPI support for SDL2. For Vulkan, everything worked like a charm ( including dpi scale, surprisedly ). For OGL, images were displayed in the bottom-left quarter. SDL2 supports HiDPI by specifying if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
int w = event.window.data1, h = event.window.data2;
if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL) {
SDL_GL_GetDrawableSize(window, &w, &h);
}
UpdateScreenScale(w, h);
} But it breaks mouse event. Need more hacking... |
|
Is this build publicly available? |
Added macbundle.sh to do it |
Bundle @LastChalice : PPSSPPQt.zip Install dependencies $ brew install sdl2 qt @hrydgard @unknownbrackets any chance to get reviewed? |
Sorry, this fell between the cracks somehow. It looks good! (I got the impression this wasn't finished because of the mouse issue above, but I assume it's fixed now since you're asking for review). |
It related to the SDL version, which I didn't touch in this PR |
Tested on macOS 10.15.2
EDIT: now we can modify Info.plist automatically