MCPcopy Create free account
hub / github.com/Alexays/Waybar / insertWindow

Method insertWindow

src/modules/hyprland/workspace.cpp:129–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void Workspace::insertWindow(WindowCreationPayload create_window_payload) {
130 if (!create_window_payload.isEmpty(m_workspaceManager)) {
131 auto repr = create_window_payload.repr(m_workspaceManager);
132
133 if (!repr.empty() || m_workspaceManager.enableTaskbar()) {
134 auto addr = create_window_payload.getAddress();
135 auto it = std::ranges::find_if(
136 m_windowMap, [&addr](const auto& window) { return window.address == addr; });
137 // If the vector contains the address, update the window representation, otherwise insert it
138 if (it != m_windowMap.end()) {
139 *it = repr;
140 } else {
141 m_windowMap.emplace_back(repr);
142 }
143 }
144 }
145};
146
147bool Workspace::onWindowOpened(WindowCreationPayload const& create_window_payload) {
148 if (create_window_payload.getWorkspaceName() == name()) {

Callers 1

onWindowTitleEventMethod · 0.80

Calls 6

emptyMethod · 0.80
enableTaskbarMethod · 0.80
getAddressMethod · 0.80
isEmptyMethod · 0.45
reprMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected