From 8e4f538cf9872ab0f44ad1e467d256e6626f768c Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 20 Mar 2006 13:18:31 +0000 Subject: some small placement fixes --- ChangeLog | 3 +++ src/ColSmartPlacement.cc | 6 +++--- src/RowSmartPlacement.cc | 4 ++-- src/ScreenPlacement.cc | 7 ++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9f1a82..6a5919e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 0.9.16: *06/03/20: + * Fix placement config (some compilers resulted in ignoring of + placement policy setting), and a minor ext. tabs placement bug + ScreenPlacement.cc Row/ColSmartPlacement.cc * External tabs (Simon) - option in Configure menu to enable - restart require at present when toggling this option diff --git a/src/ColSmartPlacement.cc b/src/ColSmartPlacement.cc index 5b84168..cb3fbd9 100644 --- a/src/ColSmartPlacement.cc +++ b/src/ColSmartPlacement.cc @@ -66,7 +66,7 @@ bool ColSmartPlacement::placeWindow(const std::vector &windowli while (!placed && (left_right ? test_x + win_w <= head_right : test_x >= head_left)) { - + if (left_right) next_x = head_right; // it will get shrunk else @@ -90,8 +90,8 @@ bool ColSmartPlacement::placeWindow(const std::vector &windowli std::vector::const_iterator it_end = windowlist.end(); for (; it != it_end && placed; ++it) { - int curr_x = (*it)->x() + (*it)->xOffset(); - int curr_y = (*it)->y() + (*it)->yOffset(); + int curr_x = (*it)->x() - (*it)->xOffset(); + int curr_y = (*it)->y() - (*it)->yOffset(); int curr_w = (*it)->width() + (*it)->fbWindow().borderWidth()*2 + (*it)->widthOffset(); int curr_h = (*it)->height() + (*it)->fbWindow().borderWidth()*2 + (*it)->heightOffset(); diff --git a/src/RowSmartPlacement.cc b/src/RowSmartPlacement.cc index 1c66a18..22ab768 100644 --- a/src/RowSmartPlacement.cc +++ b/src/RowSmartPlacement.cc @@ -103,8 +103,8 @@ bool RowSmartPlacement::placeWindow(const std::vector &windowli for (; win_it != win_it_end && placed; ++win_it) { FluxboxWindow &window = **win_it; - int curr_x = window.x() + window.xOffset(); - int curr_y = window.y() + window.yOffset(); + int curr_x = window.x() - window.xOffset(); // minus offset to get back up to fake place + int curr_y = window.y() - window.yOffset(); int curr_w = window.width() + window.fbWindow().borderWidth()*2 + window.widthOffset(); int curr_h = window.height() + window.fbWindow().borderWidth()*2 + window.heightOffset(); diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc index ef1f243..86c0804 100644 --- a/src/ScreenPlacement.cc +++ b/src/ScreenPlacement.cc @@ -47,8 +47,8 @@ ScreenPlacement::ScreenPlacement(BScreen &screen): m_placement_policy(screen.resourceManager(), ROWSMARTPLACEMENT, screen.name()+".windowPlacement", screen.altName()+".WindowPlacement"), - m_old_policy(*m_placement_policy), - m_strategy(new RowSmartPlacement()) + m_old_policy(ROWSMARTPLACEMENT), + m_strategy(0) { } @@ -56,9 +56,10 @@ bool ScreenPlacement::placeWindow(const std::vector &windowlist const FluxboxWindow &win, int &place_x, int &place_y) { + // check the resource placement and see if has changed // and if so update the strategy - if (m_old_policy != *m_placement_policy) { + if (m_old_policy != *m_placement_policy || !m_strategy.get()) { m_old_policy = *m_placement_policy; switch (*m_placement_policy) { case ROWSMARTPLACEMENT: -- cgit v0.11.2