mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 22:22:00 -07:00
internal: prevent premature destroy in moveworkspace
This commit is contained in:
@@ -1090,6 +1090,10 @@ CWorkspace* CCompositor::getWorkspaceByID(const int& id) {
|
||||
void CCompositor::sanityCheckWorkspaces() {
|
||||
auto it = m_vWorkspaces.begin();
|
||||
while (it != m_vWorkspaces.end()) {
|
||||
|
||||
if ((*it)->m_bIndestructible)
|
||||
continue;
|
||||
|
||||
const auto WINDOWSONWORKSPACE = getWindowsOnWorkspace((*it)->m_iID);
|
||||
|
||||
if ((*it)->m_bIsSpecialWorkspace && WINDOWSONWORKSPACE == 0) {
|
||||
@@ -1884,9 +1888,13 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMoni
|
||||
|
||||
Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with existing %d", nextWorkspaceOnMonitorID);
|
||||
|
||||
pWorkspace->m_bIndestructible = true; // so that changeworkspace doesn't yeet it if it's empty
|
||||
|
||||
g_pKeybindManager->focusMonitor(std::to_string(POLDMON->ID));
|
||||
g_pKeybindManager->changeworkspace(std::to_string(nextWorkspaceOnMonitorID));
|
||||
|
||||
pWorkspace->m_bIndestructible = false;
|
||||
|
||||
// move the workspace
|
||||
|
||||
pWorkspace->m_iMonitorID = pMonitor->ID;
|
||||
|
@@ -3,7 +3,8 @@
|
||||
#include "../defines.hpp"
|
||||
#include "AnimatedVariable.hpp"
|
||||
|
||||
enum eFullscreenMode : uint8_t {
|
||||
enum eFullscreenMode : uint8_t
|
||||
{
|
||||
FULLSCREEN_FULL = 0,
|
||||
FULLSCREEN_MAXIMIZED
|
||||
};
|
||||
@@ -49,6 +50,9 @@ class CWorkspace {
|
||||
bool m_bDefaultFloating = false;
|
||||
bool m_bDefaultPseudo = false;
|
||||
|
||||
// don't destroy in sanity check
|
||||
bool m_bIndestructible = false;
|
||||
|
||||
void startAnim(bool in, bool left, bool instant = false);
|
||||
void setActive(bool on);
|
||||
|
||||
|
Reference in New Issue
Block a user