Qt/macOS: enable HiDPI ( retina display ) support#12552
Qt/macOS: enable HiDPI ( retina display ) support#12552hrydgard merged 3 commits intohrydgard:masterfrom
Conversation
| // 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.
It seems that resizing the main window will trigger resizeGL automatically. This code should be unnecessary on Windows too.
| void MainWindow::SetFullScreen(bool fullscreen) { | ||
| if (fullscreen) { | ||
| #if !PPSSPP_PLATFORM(MAC) | ||
| menuBar()->hide(); |
There was a problem hiding this comment.
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.
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