Qt: Fix build on Windows.

This commit is contained in:
BearOso 2024-10-28 17:07:10 -05:00
parent b5d9217881
commit 81f189cf57
2 changed files with 14 additions and 3 deletions

View File

@ -10,6 +10,10 @@
#include <qnamespace.h> #include <qnamespace.h>
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#ifdef Q_OS_WIN
#include <dwmapi.h>
#endif
#include "EmuMainWindow.hpp" #include "EmuMainWindow.hpp"
#include "EmuSettingsWindow.hpp" #include "EmuSettingsWindow.hpp"
#include "EmuApplication.hpp" #include "EmuApplication.hpp"
@ -192,6 +196,13 @@ void EmuMainWindow::createWidgets()
setWindowTitle("Snes9x"); setWindowTitle("Snes9x");
setWindowIcon(QIcon(":/icons/snes9x.svg")); setWindowIcon(QIcon(":/icons/snes9x.svg"));
#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
auto iconset = app->iconPrefix(); auto iconset = app->iconPrefix();
// File menu // File menu

View File

@ -473,7 +473,7 @@ std::string S9xGetFilenameInc(std::string e, enum s9x_getdirtype dirtype)
i++; i++;
} while (fs::exists(new_filename)); } while (fs::exists(new_filename));
return new_filename; return new_filename.string();
} }
bool8 S9xInitUpdate() bool8 S9xInitUpdate()
@ -729,7 +729,7 @@ bool Snes9xController::slotUsed(int slot)
bool Snes9xController::loadState(int slot) bool Snes9xController::loadState(int slot)
{ {
return loadState(save_slot_path(slot)); return loadState(save_slot_path(slot).string());
} }
bool Snes9xController::loadState(std::string filename) bool Snes9xController::loadState(std::string filename)
@ -792,7 +792,7 @@ void Snes9xController::softReset()
bool Snes9xController::saveState(int slot) bool Snes9xController::saveState(int slot)
{ {
return saveState(save_slot_path(slot)); return saveState(save_slot_path(slot).string());
} }
void Snes9xController::setMessage(std::string message) void Snes9xController::setMessage(std::string message)