all repos — fluxbox @ 2e8766174eaa11e7f370ba5927ed38e18efced11

custom fork of the fluxbox windowmanager

place transient centered on its parent

so far, transients are simply unplaced, resulting in a static
0,0 position.
Thomas Lübking thomas.luebking@gmail.com
commit

2e8766174eaa11e7f370ba5927ed38e18efced11

parent

53de872163d61c87fa8128767ebbc218599f3835

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

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

@@ -461,8 +461,7 @@ bool is_visible = isWindowVisibleOnSomeHeadOrScreen(*this);

if (fluxbox.isStartup()) m_placed = true; - else if (m_client->isTransient() || - m_client->normal_hint_flags & (PPosition|USPosition)) { + else if (m_client->normal_hint_flags & (PPosition|USPosition)) { m_placed = is_visible; } else { if (!is_visible) {

@@ -484,12 +483,20 @@

if (m_workspace_number >= screen().numberOfWorkspaces()) m_workspace_number = screen().currentWorkspaceID(); + unsigned int real_width = frame().width(); + unsigned int real_height = frame().height(); + frame().applySizeHints(real_width, real_height); + // if we're a transient then we should be on the same layer and workspace FluxboxWindow* twin = m_client->transientFor() ? m_client->transientFor()->fbwindow() : 0; if (twin && twin != this) { layerItem().setLayer(twin->layerItem().getLayer()); m_state.layernum = twin->layerNum(); m_workspace_number = twin->workspaceNumber(); + const int x = twin->frame().x() + (twin->frame().width() - frame().width())/2; + const int y = twin->frame().y() + (twin->frame().height() - frame().height())/2; + frame().move(x, y); + m_placed = true; } else // if no parent then set default layer moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL);

@@ -499,10 +506,6 @@ if (twin) {

fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor->title(): "<< twin->title().logical()<<endl; } - - unsigned int real_width = frame().width(); - unsigned int real_height = frame().height(); - frame().applySizeHints(real_width, real_height); screen().getWorkspace(m_workspace_number)->addWindow(*this); if (m_placed)