From 81f189cf57fd6c507b1dc65cc48e71de111d10f7 Mon Sep 17 00:00:00 2001 From: BearOso Date: Mon, 28 Oct 2024 17:07:10 -0500 Subject: [PATCH] Qt: Fix build on Windows. --- qt/src/EmuMainWindow.cpp | 11 +++++++++++ qt/src/Snes9xController.cpp | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/qt/src/EmuMainWindow.cpp b/qt/src/EmuMainWindow.cpp index b40057b5..31bee721 100644 --- a/qt/src/EmuMainWindow.cpp +++ b/qt/src/EmuMainWindow.cpp @@ -10,6 +10,10 @@ #include #include +#ifdef Q_OS_WIN +#include +#endif + #include "EmuMainWindow.hpp" #include "EmuSettingsWindow.hpp" #include "EmuApplication.hpp" @@ -192,6 +196,13 @@ void EmuMainWindow::createWidgets() setWindowTitle("Snes9x"); setWindowIcon(QIcon(":/icons/snes9x.svg")); +#ifdef Q_OS_WIN + HWND hwnd = reinterpret_cast(winId()); + DWM_WINDOW_CORNER_PREFERENCE cornerPref = DWMWCP_DONOTROUND; + DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &cornerPref, + sizeof(cornerPref)); +#endif + auto iconset = app->iconPrefix(); // File menu diff --git a/qt/src/Snes9xController.cpp b/qt/src/Snes9xController.cpp index 9fb4294b..90a9ef68 100644 --- a/qt/src/Snes9xController.cpp +++ b/qt/src/Snes9xController.cpp @@ -473,7 +473,7 @@ std::string S9xGetFilenameInc(std::string e, enum s9x_getdirtype dirtype) i++; } while (fs::exists(new_filename)); - return new_filename; + return new_filename.string(); } bool8 S9xInitUpdate() @@ -729,7 +729,7 @@ bool Snes9xController::slotUsed(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) @@ -792,7 +792,7 @@ void Snes9xController::softReset() bool Snes9xController::saveState(int slot) { - return saveState(save_slot_path(slot)); + return saveState(save_slot_path(slot).string()); } void Snes9xController::setMessage(std::string message)