mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-24 06:25:59 +01:00
Replaced m_pPreviouslySwallowed with a boolean
This commit is contained in:
parent
5a520914ac
commit
07848e7f59
4 changed files with 18 additions and 18 deletions
|
@ -208,7 +208,7 @@ static std::string getWindowData(CWindow* w, eHyprCtlOutputFormat format) {
|
|||
escapeJSONStrings(g_pXWaylandManager->getAppIDClass(w)), escapeJSONStrings(g_pXWaylandManager->getTitle(w)), escapeJSONStrings(w->m_szInitialClass),
|
||||
escapeJSONStrings(w->m_szInitialTitle), w->getPID(), ((int)w->m_bIsX11 == 1 ? "true" : "false"), (w->m_bPinned ? "true" : "false"),
|
||||
(w->m_bIsFullscreen ? "true" : "false"), (w->m_bIsFullscreen ? (w->m_pWorkspace ? (int)w->m_pWorkspace->m_efFullscreenMode : 0) : 0),
|
||||
w->m_bFakeFullscreenState ? "true" : "false", getGroupedData(w, format), (uintptr_t)w->m_pSwallowed, getFocusHistoryID(w));
|
||||
w->m_bFakeFullscreenState ? "true" : "false", getGroupedData(w, format), w->m_bCurrentlySwallowing ? (uintptr_t)w->m_pSwallowed : 0, getFocusHistoryID(w));
|
||||
} else {
|
||||
return std::format("Window {:x} -> {}:\n\tmapped: {}\n\thidden: {}\n\tat: {},{}\n\tsize: {},{}\n\tworkspace: {} ({})\n\tfloating: {}\n\tmonitor: {}\n\tclass: {}\n\ttitle: "
|
||||
"{}\n\tinitialClass: {}\n\tinitialTitle: {}\n\tpid: "
|
||||
|
@ -219,7 +219,7 @@ static std::string getWindowData(CWindow* w, eHyprCtlOutputFormat format) {
|
|||
(!w->m_pWorkspace ? "" : std::to_string(w->workspaceID())), (int)w->m_bIsFloating, (int64_t)w->m_iMonitorID, g_pXWaylandManager->getAppIDClass(w),
|
||||
g_pXWaylandManager->getTitle(w), w->m_szInitialClass, w->m_szInitialTitle, w->getPID(), (int)w->m_bIsX11, (int)w->m_bPinned, (int)w->m_bIsFullscreen,
|
||||
(w->m_bIsFullscreen ? (w->m_pWorkspace ? w->m_pWorkspace->m_efFullscreenMode : 0) : 0), (int)w->m_bFakeFullscreenState, getGroupedData(w, format),
|
||||
(uintptr_t)w->m_pSwallowed, getFocusHistoryID(w));
|
||||
w->m_bCurrentlySwallowing ? (uintptr_t)w->m_pSwallowed : 0, getFocusHistoryID(w));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -341,8 +341,8 @@ class CWindow {
|
|||
|
||||
// swallowing
|
||||
CWindow* m_pSwallowed = nullptr;
|
||||
CWindow* m_pPreviouslySwallowed = nullptr;
|
||||
CWindow* m_pSwallowedBy = nullptr;
|
||||
bool m_bCurrentlySwallowing = false;
|
||||
|
||||
// focus stuff
|
||||
bool m_bStayFocused = false;
|
||||
|
|
|
@ -585,6 +585,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
|||
// swallow
|
||||
PWINDOW->m_pSwallowed = finalFound;
|
||||
finalFound->m_pSwallowedBy = PWINDOW;
|
||||
PWINDOW->m_bCurrentlySwallowing = true;
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(finalFound);
|
||||
|
||||
|
|
|
@ -1823,25 +1823,24 @@ void CKeybindManager::focusWindow(std::string regexp) {
|
|||
|
||||
void CKeybindManager::toggleSwallow(std::string args) {
|
||||
CWindow* pWindow = g_pCompositor->m_pLastWindow;
|
||||
if (pWindow->m_pSwallowed) {
|
||||
pWindow->m_pPreviouslySwallowed = pWindow->m_pSwallowed;
|
||||
|
||||
if (!pWindow->m_pSwallowed)
|
||||
return;
|
||||
|
||||
if (pWindow->m_bCurrentlySwallowing) {
|
||||
// Unswallow
|
||||
pWindow->m_pSwallowed->setHidden(false);
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowCreated(pWindow->m_pSwallowed);
|
||||
|
||||
pWindow->m_pSwallowed->m_pSwallowedBy = nullptr;
|
||||
pWindow->m_pSwallowed = nullptr;
|
||||
|
||||
} else if (pWindow->m_pPreviouslySwallowed) {
|
||||
pWindow->m_pSwallowed = pWindow->m_pPreviouslySwallowed;
|
||||
pWindow->m_pSwallowed->m_pSwallowedBy = pWindow;
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow->m_pPreviouslySwallowed);
|
||||
|
||||
pWindow->m_pPreviouslySwallowed->setHidden(true);
|
||||
pWindow->m_bCurrentlySwallowing = false;
|
||||
} else {
|
||||
// Reswallow
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow->m_pSwallowed);
|
||||
pWindow->m_pSwallowed->setHidden(true);
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(pWindow->m_iMonitorID);
|
||||
|
||||
pWindow->m_bCurrentlySwallowing = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue