layout: improve initial size prediction for floating
This commit is contained in:
parent
2930c5cb6f
commit
fcd9d77b64
7 changed files with 67 additions and 23 deletions
|
|
@ -782,22 +782,7 @@ void Events::listener_commitWindow(void* owner, void* data) {
|
|||
CWindow* PWINDOW = (CWindow*)owner;
|
||||
|
||||
if (!PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xdg->initial_commit) {
|
||||
Vector2D predSize = g_pLayoutManager->getCurrentLayout()->predictSizeForNewWindow();
|
||||
|
||||
if (g_pXWaylandManager->shouldBeFloated(PWINDOW, true))
|
||||
predSize = {};
|
||||
|
||||
Vector2D maxSize = Vector2D{PWINDOW->m_uSurface.xdg->toplevel->pending.max_width, PWINDOW->m_uSurface.xdg->toplevel->pending.max_height};
|
||||
|
||||
if ((maxSize.x > 0 && maxSize.x < predSize.x) || (maxSize.y > 0 && maxSize.y < predSize.y))
|
||||
predSize = {};
|
||||
|
||||
for (auto& r : g_pConfigManager->getMatchingRules(PWINDOW, true, true)) {
|
||||
if (r.szRule.starts_with("float")) {
|
||||
predSize = {};
|
||||
break;
|
||||
}
|
||||
}
|
||||
Vector2D predSize = g_pLayoutManager->getCurrentLayout()->predictSizeForNewWindow(PWINDOW);
|
||||
|
||||
Debug::log(LOG, "Layout predicts size {} for {}", predSize, PWINDOW);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue