target: fix geometry for x11 floats
This commit is contained in:
parent
fbf67ef050
commit
c60b3cb2ed
2 changed files with 8 additions and 4 deletions
|
|
@ -88,7 +88,9 @@ void CDefaultFloatingAlgorithm::newTarget(SP<ITarget> target) {
|
||||||
if (!posOverridden && (!DESIRED_GEOM || !DESIRED_GEOM->pos))
|
if (!posOverridden && (!DESIRED_GEOM || !DESIRED_GEOM->pos))
|
||||||
windowGeometry = CBox{WORK_AREA.middle() - windowGeometry.size() / 2.F, windowGeometry.size()};
|
windowGeometry = CBox{WORK_AREA.middle() - windowGeometry.size() / 2.F, windowGeometry.size()};
|
||||||
|
|
||||||
if (posOverridden || WORK_AREA.containsPoint(windowGeometry.middle()))
|
if (posOverridden // pos is overridden by a rule
|
||||||
|
|| (DESIRED_GEOM && DESIRED_GEOM->pos && target->window() && target->window()->m_isX11) // X11 window with a geom
|
||||||
|
|| WORK_AREA.containsPoint(windowGeometry.middle())) // geometry within work area
|
||||||
target->setPositionGlobal(windowGeometry);
|
target->setPositionGlobal(windowGeometry);
|
||||||
else {
|
else {
|
||||||
const auto POS = WORK_AREA.middle() - windowGeometry.size() / 2.f;
|
const auto POS = WORK_AREA.middle() - windowGeometry.size() / 2.f;
|
||||||
|
|
|
||||||
|
|
@ -249,9 +249,11 @@ std::expected<SGeometryRequested, eGeometryFailure> CWindowTarget::desiredGeomet
|
||||||
requested.size = clampSizeForDesired(DESIRED_GEOM.size());
|
requested.size = clampSizeForDesired(DESIRED_GEOM.size());
|
||||||
|
|
||||||
if (m_window->m_isX11) {
|
if (m_window->m_isX11) {
|
||||||
Vector2D xy = {DESIRED_GEOM.x, DESIRED_GEOM.y};
|
Vector2D xy = {DESIRED_GEOM.x, DESIRED_GEOM.y};
|
||||||
xy = g_pXWaylandManager->xwaylandToWaylandCoords(xy);
|
xy = g_pXWaylandManager->xwaylandToWaylandCoords(xy);
|
||||||
requested.pos = xy;
|
requested.pos = xy;
|
||||||
|
DESIRED_GEOM.x = xy.x;
|
||||||
|
DESIRED_GEOM.y = xy.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto STOREDSIZE = m_window->m_ruleApplicator->persistentSize().valueOrDefault() ? g_pConfigManager->getStoredFloatingSize(m_window.lock()) : std::nullopt;
|
const auto STOREDSIZE = m_window->m_ruleApplicator->persistentSize().valueOrDefault() ? g_pConfigManager->getStoredFloatingSize(m_window.lock()) : std::nullopt;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue