all repos — fluxbox @ 0d1b204121ba7168b03cd960e3a616b7b9a6c9b1

custom fork of the fluxbox windowmanager

re-use position sanitization for modal placement
Thomas Lübking thomas.luebking@gmail.com
commit

0d1b204121ba7168b03cd960e3a616b7b9a6c9b1

parent

6ca6422344f0046ef1794c5fbaea90d28692fd5f

1 files changed, 9 insertions(+), 5 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -457,11 +457,7 @@ associateClientWindow();

setWindowType(m_client->getWindowType()); - if (fluxbox.isStartup()) { - m_placed = true; - } else if (m_client->normal_hint_flags & (PPosition|USPosition)) { - m_placed = true; - // sanitize explicit position + auto sanitizePosition = [&]() { int head = screen().getHead(fbWindow()); if (head == 0 && screen().hasXinerama()) head = screen().getCurrHead();

@@ -489,6 +485,13 @@ else

top = frame().y(); } frame().move(left, top); + }; + + if (fluxbox.isStartup()) { + m_placed = true; + } else if (m_client->normal_hint_flags & (PPosition|USPosition)) { + m_placed = true; + sanitizePosition(); } else { if (!isWindowVisibleOnSomeHeadOrScreen(*this)) { // this probably should never happen, but if a window

@@ -544,6 +547,7 @@ m_workspace_number = twin->workspaceNumber();

const int x = twin->frame().x() + int(twin->frame().width() - frame().width())/2; const int y = twin->frame().y() + int(twin->frame().height() - frame().height())/2; frame().move(x, y); + sanitizePosition(); m_placed = true; } else // if no parent then set default layer moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL);