layout: don't discard fullscreen on new tiling

This commit is contained in:
vaxerski 2023-09-28 17:49:33 +01:00
parent 6d7dc70f66
commit 1f4eab176e
8 changed files with 19 additions and 38 deletions

View file

@ -2148,14 +2148,16 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode
const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID); const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID);
const auto MODE = mode == FULLSCREEN_INVALID ? PWORKSPACE->m_efFullscreenMode : mode;
if (PWORKSPACE->m_bHasFullscreenWindow && on) { if (PWORKSPACE->m_bHasFullscreenWindow && on) {
Debug::log(LOG, "Rejecting fullscreen ON on a fullscreen workspace"); Debug::log(LOG, "Rejecting fullscreen ON on a fullscreen workspace");
return; return;
} }
g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, mode, on); g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, MODE, on);
g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL); g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && MODE == FULLSCREEN_FULL);
pWindow->updateDynamicRules(); pWindow->updateDynamicRules();
updateWindowAnimatedDecorationValues(pWindow); updateWindowAnimatedDecorationValues(pWindow);

View file

@ -263,13 +263,6 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->applyDynamicRule(r); PWINDOW->applyDynamicRule(r);
} }
CWindow* pFullscreenWindow = nullptr;
if (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->m_bIsFloating) {
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
pFullscreenWindow = PFULLWINDOW;
g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, PWORKSPACE->m_efFullscreenMode);
}
PWINDOW->updateSpecialRenderData(); PWINDOW->updateSpecialRenderData();
// disallow tiled pinned // disallow tiled pinned
@ -543,10 +536,6 @@ void Events::listener_mapWindow(void* owner, void* data) {
} }
} }
if (pFullscreenWindow && workspaceSilent) {
g_pCompositor->setWindowFullscreen(pFullscreenWindow, true, PWORKSPACE->m_efFullscreenMode);
}
// recheck idle inhibitors // recheck idle inhibitors
g_pInputManager->recheckIdleInhibitorStatus(); g_pInputManager->recheckIdleInhibitorStatus();

View file

@ -4,8 +4,9 @@
#include <string> #include <string>
#include "../defines.hpp" #include "../defines.hpp"
enum eFullscreenMode : uint8_t enum eFullscreenMode : int8_t
{ {
FULLSCREEN_INVALID = -1,
FULLSCREEN_FULL = 0, FULLSCREEN_FULL = 0,
FULLSCREEN_MAXIMIZED FULLSCREEN_MAXIMIZED
}; };

View file

@ -291,13 +291,6 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire
return; return;
} }
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
if (PWORKSPACE->m_bHasFullscreenWindow) {
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL);
}
// last fail-safe to avoid duplicate fullscreens // last fail-safe to avoid duplicate fullscreens
if ((!OPENINGON || OPENINGON->pWindow == pWindow) && getNodesOnWorkspace(PNODE->workspaceID) > 1) { if ((!OPENINGON || OPENINGON->pWindow == pWindow) && getNodesOnWorkspace(PNODE->workspaceID) > 1) {
for (auto& node : m_lDwindleNodesData) { for (auto& node : m_lDwindleNodesData) {
@ -481,8 +474,8 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire
NEWPARENT->recalcSizePosRecursive(false, horizontalOverride, verticalOverride); NEWPARENT->recalcSizePosRecursive(false, horizontalOverride, verticalOverride);
applyNodeDataToWindow(PNODE); recalculateMonitor(pWindow->m_iMonitorID);
applyNodeDataToWindow(OPENINGON);
pWindow->applyGroupRules(); pWindow->applyGroupRules();
} }

View file

@ -9,7 +9,7 @@
#include <format> #include <format>
class CHyprDwindleLayout; class CHyprDwindleLayout;
enum eFullscreenMode : uint8_t; enum eFullscreenMode : int8_t;
struct SDwindleNodeData { struct SDwindleNodeData {
SDwindleNodeData* pParent = nullptr; SDwindleNodeData* pParent = nullptr;

View file

@ -13,9 +13,10 @@ struct SLayoutMessageHeader {
CWindow* pWindow = nullptr; CWindow* pWindow = nullptr;
}; };
enum eFullscreenMode : uint8_t; enum eFullscreenMode : int8_t;
enum eRectCorner { enum eRectCorner
{
CORNER_NONE = 0, CORNER_NONE = 0,
CORNER_TOPLEFT, CORNER_TOPLEFT,
CORNER_TOPRIGHT, CORNER_TOPRIGHT,
@ -23,7 +24,8 @@ enum eRectCorner {
CORNER_BOTTOMLEFT CORNER_BOTTOMLEFT
}; };
enum eDirection { enum eDirection
{
DIRECTION_DEFAULT = -1, DIRECTION_DEFAULT = -1,
DIRECTION_UP = 0, DIRECTION_UP = 0,
DIRECTION_RIGHT, DIRECTION_RIGHT,

View file

@ -167,13 +167,6 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc
} }
} }
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
if (PWORKSPACE->m_bHasFullscreenWindow) {
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL);
}
// recalc // recalc
recalculateMonitor(pWindow->m_iMonitorID); recalculateMonitor(pWindow->m_iMonitorID);
} }

View file

@ -7,10 +7,11 @@
#include <deque> #include <deque>
#include <any> #include <any>
enum eFullscreenMode : uint8_t; enum eFullscreenMode : int8_t;
//orientation determines which side of the screen the master area resides //orientation determines which side of the screen the master area resides
enum eOrientation : uint8_t { enum eOrientation : uint8_t
{
ORIENTATION_LEFT = 0, ORIENTATION_LEFT = 0,
ORIENTATION_TOP, ORIENTATION_TOP,
ORIENTATION_RIGHT, ORIENTATION_RIGHT,