Set limit on how many windows in special workspace

This commit is contained in:
Lampros Pitsillos 2023-09-03 23:42:23 +03:00
parent 8fefb180b1
commit df2a0b9cd9
2 changed files with 9 additions and 0 deletions

View file

@ -417,6 +417,8 @@ void CWindow::onUnmap() {
void CWindow::onMap() { void CWindow::onMap() {
static auto* const PISOLATESPECIAL = &g_pConfigManager->getConfigValuePtr("misc:isolate_special")->intValue;
m_pWLSurface.assign(g_pXWaylandManager->getWindowSurface(this)); m_pWLSurface.assign(g_pXWaylandManager->getWindowSurface(this));
// JIC, reset the callbacks. If any are set, we'll make sure they are cleared so we don't accidentally unset them. (In case a window got remapped) // JIC, reset the callbacks. If any are set, we'll make sure they are cleared so we don't accidentally unset them. (In case a window got remapped)
@ -447,6 +449,12 @@ void CWindow::onMap() {
hyprListener_unmapWindow.initCallback(m_bIsX11 ? &m_uSurface.xwayland->surface->events.unmap : &m_uSurface.xdg->surface->events.unmap, &Events::listener_unmapWindow, this, hyprListener_unmapWindow.initCallback(m_bIsX11 ? &m_uSurface.xwayland->surface->events.unmap : &m_uSurface.xdg->surface->events.unmap, &Events::listener_unmapWindow, this,
"CWindow"); "CWindow");
if (*PISOLATESPECIAL && g_pCompositor->getWindowsOnWorkspace(m_iWorkspaceID) > *PISOLATESPECIAL && g_pCompositor->isWorkspaceSpecial(m_iWorkspaceID)) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
this->moveToWorkspace(PMONITOR->activeWorkspace);
}
} }
void CWindow::onBorderAngleAnimEnd(void* ptr) { void CWindow::onBorderAngleAnimEnd(void* ptr) {

View file

@ -114,6 +114,7 @@ void CConfigManager::setDefaultVars() {
configValues["misc:groupbar_titles_font_size"].intValue = 8; configValues["misc:groupbar_titles_font_size"].intValue = 8;
configValues["misc:groupbar_gradients"].intValue = 1; configValues["misc:groupbar_gradients"].intValue = 1;
configValues["misc:close_special_on_empty"].intValue = 1; configValues["misc:close_special_on_empty"].intValue = 1;
configValues["misc:isolate_special"].intValue = 0;
configValues["misc:groupbar_text_color"].intValue = 0xffffffff; configValues["misc:groupbar_text_color"].intValue = 0xffffffff;
configValues["misc:background_color"].intValue = 0xff111111; configValues["misc:background_color"].intValue = 0xff111111;