Skip to content

Commit

Permalink
add sizes for new floating windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Aqa-Ib committed Sep 30, 2024
1 parent 0da91e9 commit 9db0b90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/layout/IHyprLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@

void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
if (pWindow->m_bIsFloating) {
CBox desiredGeometry = {};
g_pXWaylandManager->getGeometryForWindow(pWindow, &desiredGeometry);

if (desiredGeometry.width <= 5 || desiredGeometry.height <= 5) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
pWindow->m_vLastFloatingSize = PMONITOR->vecSize / 2.f;
} else {
pWindow->m_vLastFloatingSize = Vector2D(desiredGeometry.width, desiredGeometry.height);
}

pWindow->m_vPseudoSize = pWindow->m_vLastFloatingSize;

bool autoGrouped = IHyprLayout::onWindowCreatedAutoGroup(pWindow);
if (autoGrouped)
return;
Expand Down

0 comments on commit 9db0b90

Please sign in to comment.