MCPcopy Create free account
hub / github.com/Maplespe/DWMBlurGlass / GetOrCreate

Function GetOrCreate

DWMBlurGlassExt/Section/VisualManager.cpp:55–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 com_ptr<DCompPrivate::ICompositedBackdropVisual> GetOrCreate(DWM::CTopLevelWindow* window, bool createIfNecessary,
56 bool silent)
57 {
58 auto it{ g_backdropMap.find(window) };
59
60 if (createIfNecessary)
61 {
62 auto data{ window->GetData() };
63
64 if (
65 data &&
66 it == g_backdropMap.end()
67 )
68 {
69 HWND targetWindow{ data->GetHWND() };
70 HWND shellWindow{ DWM::GetShellWindowForCurrentDesktop() };
71
72 if (targetWindow != shellWindow)
73 {
74 auto result{ g_backdropMap.emplace(window, winrt::make<CCompositedBackdropVisual>(window)) };
75 if (result.second == true)
76 {
77 it = result.first;
78
79 if (!silent)
80 {
81 RedrawTopLevelWindow(window);
82 }
83 }
84 }
85 }
86 }
87
88 return it == g_backdropMap.end() ? nullptr : it->second;
89 }
90
91 com_ptr<DCompPrivate::ICompositedBackdropVisual> GetOrCreateForAccentBlurRect(DWM::CTopLevelWindow* window,
92 LPCRECT accentBlurRect, bool createIfNecessary, bool silent)

Callers 8

TryCloneFunction · 0.85
RefreshFunction · 0.85

Calls 5

RedrawTopLevelWindowFunction · 0.85
GetDataMethod · 0.80
GetHWNDMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected