Skip to content

Commit

Permalink
app: Disable round window corners on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Macdu committed Sep 7, 2024
1 parent 2624242 commit 3f5a008
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions vita3k/app/src/app_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
#include <SDL_video.h>
#include <SDL_vulkan.h>

#ifdef WIN32
#pragma comment(lib, "Dwmapi")
#include <SDL_syswm.h>
#include <dwmapi.h>
#endif

namespace app {
void update_viewport(EmuEnvState &state) {
int w = 0;
Expand Down Expand Up @@ -327,6 +333,15 @@ bool init(EmuEnvState &state, Config &cfg, const Root &root_paths) {
return false;
}

#ifdef WIN32
// Disable round corners for the game window
SDL_SysWMinfo wm_info;
SDL_VERSION(&wm_info.version);
SDL_GetWindowWMInfo(state.window.get(), &wm_info);
const auto window_preference = DWMWCP_DONOTROUND;
DwmSetWindowAttribute(wm_info.info.win.window, DWMWA_WINDOW_CORNER_PREFERENCE, &window_preference, sizeof(window_preference));
#endif

// initialize the renderer first because we need to know if we need a page table
if (!state.cfg.console) {
if (renderer::init(state.window.get(), state.renderer, state.backend_renderer, state.cfg, root_paths)) {
Expand Down

0 comments on commit 3f5a008

Please sign in to comment.