Split unplaced transient and dialog handling

Shouldn't make much difference but makes the code a bit easier to
follow.
This commit is contained in:
Kim Woelders 2019-03-03 19:23:08 +01:00
parent 524540f7a8
commit c23bca5c26
1 changed files with 7 additions and 2 deletions

View File

@ -946,9 +946,9 @@ AddToFamily(EWin * ewin, EX_Window xwin, XWindowAttributes * pxwa, int startup)
x = MAX(x, sx);
y = MAX(y, sy);
}
else if (ewin->ewmh.type.b.dialog)
else if (ewin->icccm.transient)
{
/* Center unplaced dialogs on parent(if transient) or root */
/* Center unplaced transients on parent (or root) */
Win parent;
ewin2 = NULL;
@ -970,6 +970,11 @@ AddToFamily(EWin * ewin, EX_Window xwin, XWindowAttributes * pxwa, int startup)
x = MAX(x, sx);
y = MAX(y, sy);
}
else if (ewin->ewmh.type.b.dialog)
{
/* Center unplaced (non-transient) dialogs on root */
ArrangeEwinCenteredXY(ewin, &x, &y);
}
else
{
ArrangeEwinXY(ewin, &x, &y);