From 2e8766174eaa11e7f370ba5927ed38e18efced11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 31 Mar 2016 13:31:21 +0200 Subject: place transient centered on its parent so far, transients are simply unplaced, resulting in a static 0,0 position. --- src/Window.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index 9129e7d..109b522 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -461,8 +461,7 @@ void FluxboxWindow::init() { 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 @@ void FluxboxWindow::init() { 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); @@ -500,10 +507,6 @@ void FluxboxWindow::init() { twin->title().logical()<addWindow(*this); if (m_placed) moveResize(frame().x(), frame().y(), real_width, real_height); -- cgit v0.11.2