Skip to content

Commit

Permalink
Enabled drag-n-drop functionality (for INI files) for all graphics AP…
Browse files Browse the repository at this point in the history
…Is; texture mod drag-n-drop still requires D3D11.
  • Loading branch information
Kaldaien committed Feb 16, 2025
1 parent e9e4e54 commit 7de402f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

25.2.16.3
25.2.16.3
=========
+ Enabled drag-n-drop functionality (for INI files) for all graphics APIs;
texture mod drag-n-drop still requires D3D11.
+ Added config profile for Avowed and set "Treat Foreground Window as Active",
because the game is using the wrong test for window activation.
+ Added an INI option to control whether Alt+Tab stuck-key fixes are
Expand Down
25 changes: 11 additions & 14 deletions include/imgui/imgui_user.inl
Original file line number Diff line number Diff line change
Expand Up @@ -3590,6 +3590,9 @@ public:
return S_OK;
};

auto& rb =
SK_GetCurrentRenderBackend ();

// Unicode URLs
if (m_fmtDropping->cfFormat == CF_UNICODETEXT && SUCCEEDED (pDataObj->GetData (m_fmtDropping, &medium)))
{
Expand Down Expand Up @@ -3673,7 +3676,7 @@ public:
}
}

if (StrStrIW (wszSource, L".dds"))
if (SK_API_IsLayeredOnD3D11 (rb.api) && StrStrIW (wszSource, L".dds"))
{
std::filesystem::path dest =
*SK_D3D11_res_root;
Expand Down Expand Up @@ -3850,7 +3853,7 @@ public:
}
}

if (StrStrIA (szSource, ".dds"))
if (SK_API_IsLayeredOnD3D11 (rb.api) && StrStrIA (szSource, ".dds"))
{
std::filesystem::path dest =
*SK_D3D11_res_root;
Expand Down Expand Up @@ -3936,18 +3939,12 @@ private:
void
SK_ImGui_InitDragAndDrop (void)
{
auto& rb =
SK_GetCurrentRenderBackend ();

if (SK_API_IsLayeredOnD3D11 (rb.api))
{
SK_RunOnce (
OleInitialize (nullptr);
SK_SetWindowLongPtrW (game_window.hWnd, GWL_EXSTYLE, SK_GetWindowLongPtrW (game_window.hWnd, GWL_EXSTYLE) | WS_EX_ACCEPTFILES);
RevokeDragDrop (game_window.hWnd);
RegisterDragDrop (game_window.hWnd, new SK_DropTarget (game_window.hWnd))
);
}
SK_RunOnce (
OleInitialize (nullptr);
SK_SetWindowLongPtrW (game_window.hWnd, GWL_EXSTYLE, SK_GetWindowLongPtrW (game_window.hWnd, GWL_EXSTYLE) | WS_EX_ACCEPTFILES);
RevokeDragDrop (game_window.hWnd);
RegisterDragDrop (game_window.hWnd, new SK_DropTarget (game_window.hWnd))
);
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/storefront/epic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ SK::EOS::Init (bool pre_load)
L"EOSSDK-Win32-Shipping.dll" );

static HMODULE hModEOS = nullptr;
if (std::exchange (hModEOS, SK_LoadLibraryW (wszEOSDLLName)) == nullptr)
if (std::exchange (hModEOS, SK_LoadLibraryW (wszEOSDLLName)) == nullptr && hModEOS != nullptr)
{
epic_log->init (L"logs/eos.log", L"wt+,ccs=UTF-8");
epic_log->silent = config.platform.silent;
Expand Down
19 changes: 19 additions & 0 deletions src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,25 @@ GetWindowInfo_Detour (HWND hwnd, PWINDOWINFO pwi)
pwi->cbSize == sizeof (WINDOWINFO) &&
bRet )
{
if (config.window.borderless)
{
pwi->cxWindowBorders = 0;
pwi->cyWindowBorders = 0;
}

// DXGI checks on this during SwapChain creation...
// lie to DXGI if we have to, so that SwapCHain creation succeeds.
if (StrStrIW (SK_GetCallerName ().c_str (), L"dxgi.dll"))
{
pwi->dwExStyle &= ~WS_EX_TOPMOST;

if ( config.render.framerate.flip_discard ||
config.render.framerate.flip_sequential )
{
pwi->dwExStyle |= WS_EX_NOREDIRECTIONBITMAP;
}
}

if (SK_WantBackgroundRender ())
{
if (hwnd == game_window.hWnd)
Expand Down

0 comments on commit 7de402f

Please sign in to comment.