Qt: Make window corners square on Windows 11 (fixes #3285)

This commit is contained in:
Vicki Pfau 2024-09-19 00:05:58 -07:00
parent 11787df6cd
commit c64dbd6631
2 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,7 @@ Misc:
- Qt: Remove maligned double-click-to-fullscreen shortcut (closes mgba.io/i/2632)
- Qt: Pass logging context through to video proxy thread (fixes mgba.io/i/3095)
- Qt: Show maker code and game version in ROM info
- Qt: Make window corners square on Windows 11 (fixes mgba.io/i/3285)
- Res: Port NSO-gba-colors shader (closes mgba.io/i/2834)
- Scripting: Add `callbacks:oneshot` for single-call callbacks
- Switch: Add bilinear filtering option (closes mgba.io/i/3111)

View File

@ -14,6 +14,10 @@
#include <QScreen>
#include <QWindow>
#ifdef Q_OS_WIN
#include <dwmapi.h>
#endif
#ifdef USE_SQLITE3
#include "ArchiveInspector.h"
#include "library/LibraryController.h"
@ -717,6 +721,11 @@ void Window::showEvent(QShowEvent* event) {
return;
}
m_wasOpened = true;
#ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(winId());
DWM_WINDOW_CORNER_PREFERENCE cornerPref = DWMWCP_DONOTROUND;
DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &cornerPref, sizeof(cornerPref));
#endif
if (m_initialSize.isValid()) {
resizeFrame(m_initialSize);
}