Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit dec5796

Browse files
committed
Fix abnormal behaviour in Minecraft Launcher
Fix menu animation scailing issues Add new menu animation styles
1 parent bd8514d commit dec5796

6 files changed

+303
-194
lines changed

TFMain/DXHelper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "pch.h"
1+
#include "pch.h"
22
#include "Utils.hpp"
33
#include "Hooking.hpp"
44
#include "DXHelper.hpp"
@@ -183,8 +183,7 @@ void LazyD2D::CreateDeviceResources()
183183
// Always use software rendering, otherwise the performance is pretty bad!
184184
// The reason is you incur costs transferring from GPU to System
185185
D2D1_RENDER_TARGET_TYPE_SOFTWARE,
186-
PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
187-
96.f, 96.f
186+
PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED)
188187
)
189188
};
190189

@@ -197,6 +196,7 @@ void LazyD2D::CreateDeviceResources()
197196
);
198197

199198
dcRT->SetAntialiasMode(D2D1_ANTIALIAS_MODE::D2D1_ANTIALIAS_MODE_PER_PRIMITIVE);
199+
dcRT.query<ID2D1DeviceContext>()->SetUnitMode(D2D1_UNIT_MODE::D2D1_UNIT_MODE_PIXELS);
200200
dcRT.copy_to(&m_dcRT);
201201
}
202202
catch (...)

TFMain/ImmersiveContextMenuPatcher.cpp

-30
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,6 @@ using namespace TranslucentFlyouts;
1313

1414
namespace TranslucentFlyouts::ImmersiveContextMenuPatcher
1515
{
16-
// A list of modules that contain the symbol of C++ class ImmersiveContextMenuHelper,
17-
// which it means these modules provide methods to create a immersive context menu
18-
const array g_hookModuleList
19-
{
20-
L"explorer.exe"sv,
21-
L"Narrator.exe"sv,
22-
L"MusNotifyIcon.exe"sv,
23-
L"ApplicationFrame.dll"sv,
24-
L"ExplorerFrame.dll"sv,
25-
L"InputSwitch.dll"sv,
26-
L"pnidui.dll"sv,
27-
L"SecurityHealthSSO.dll"sv,
28-
L"shell32.dll"sv,
29-
L"SndVolSSO.dll"sv,
30-
L"twinui.dll"sv,
31-
L"twinui.pcshell.dll"sv,
32-
L"bthprops.cpl"sv,
33-
// Windows 11
34-
L"Taskmgr.exe"sv,
35-
L"museuxdocked.dll"sv,
36-
L"SecurityHealthSsoUdk.dll"sv,
37-
L"Taskbar.dll"sv,
38-
L"Windows.UI.FileExplorer.dll"sv,
39-
L"Windows.UI.FileExplorer.WASDK.dll"sv,
40-
L"stobject.dll"sv,
41-
// Third-party apps
42-
L"StartIsBack64.dll"sv,
43-
L"StartIsBack32.dll"sv
44-
};
45-
4616
int WINAPI DrawTextW(
4717
HDC hdc,
4818
LPCWSTR lpchText,

TFMain/ImmersiveContextMenuPatcher.hpp

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,46 @@
1-
#pragma once
1+
#pragma once
22
#include "pch.h"
33

44
namespace TranslucentFlyouts
55
{
66
// Tweak the appearance of immersive context menu
77
namespace ImmersiveContextMenuPatcher
88
{
9+
namespace
10+
{
11+
using namespace std::literals;
12+
// A list of modules that contain the symbol of C++ class ImmersiveContextMenuHelper,
13+
// which it means these modules provide methods to create a immersive context menu
14+
constexpr std::array g_hookModuleList
15+
{
16+
L"explorer.exe"sv,
17+
L"Narrator.exe"sv,
18+
L"minecraft.exe"sv, // Minecraft Launcher
19+
L"MusNotifyIcon.exe"sv,
20+
L"ApplicationFrame.dll"sv,
21+
L"ExplorerFrame.dll"sv,
22+
L"InputSwitch.dll"sv,
23+
L"pnidui.dll"sv,
24+
L"SecurityHealthSSO.dll"sv,
25+
L"shell32.dll"sv,
26+
L"SndVolSSO.dll"sv,
27+
L"twinui.dll"sv,
28+
L"twinui.pcshell.dll"sv,
29+
L"bthprops.cpl"sv,
30+
// Windows 11
31+
L"Taskmgr.exe"sv,
32+
L"museuxdocked.dll"sv,
33+
L"SecurityHealthSsoUdk.dll"sv,
34+
L"Taskbar.dll"sv,
35+
L"Windows.UI.FileExplorer.dll"sv,
36+
L"Windows.UI.FileExplorer.WASDK.dll"sv,
37+
L"stobject.dll"sv,
38+
// Third-party apps
39+
L"StartIsBack64.dll"sv,
40+
L"StartIsBack32.dll"sv
41+
};
42+
}
43+
944
HRESULT WINAPI DrawThemeBackground(
1045
HTHEME hTheme,
1146
HDC hdc,

0 commit comments

Comments
 (0)