aboutsummaryrefslogtreecommitdiff
path: root/src/RowSmartPlacement.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/RowSmartPlacement.cc')
-rw-r--r--src/RowSmartPlacement.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/RowSmartPlacement.cc b/src/RowSmartPlacement.cc
index ec6078f..6457d59 100644
--- a/src/RowSmartPlacement.cc
+++ b/src/RowSmartPlacement.cc
@@ -23,26 +23,38 @@
23 23
24#include "RowSmartPlacement.hh" 24#include "RowSmartPlacement.hh"
25 25
26#include "FocusControl.hh"
26#include "Window.hh" 27#include "Window.hh"
27#include "Screen.hh" 28#include "Screen.hh"
28#include "ScreenPlacement.hh" 29#include "ScreenPlacement.hh"
29 30
30bool RowSmartPlacement::placeWindow(const std::list<FluxboxWindow *> &windowlist, 31bool RowSmartPlacement::placeWindow(const FluxboxWindow &win, int head,
31 const FluxboxWindow &win,
32 int &place_x, int &place_y) { 32 int &place_x, int &place_y) {
33 33
34 std::list<FluxboxWindow *> windowlist;
35 const std::list<Focusable *> focusables =
36 win.screen().focusControl().focusedOrderWinList();
37 std::list<Focusable *>::const_iterator foc_it = focusables.begin(),
38 foc_it_end = focusables.end();
39 unsigned int workspace = win.workspaceNumber();
40 for (; foc_it != foc_it_end; ++foc_it) {
41 // make sure it's a FluxboxWindow
42 if (*foc_it == (*foc_it)->fbwindow() &&
43 (workspace == (*foc_it)->fbwindow()->workspaceNumber() ||
44 (*foc_it)->fbwindow()->isStuck()))
45 windowlist.push_back((*foc_it)->fbwindow());
46 }
47
34 bool placed = false; 48 bool placed = false;
35 int next_x, next_y; 49 int next_x, next_y;
36 50
37 // view (screen + head) constraints 51 // view (screen + head) constraints
38 int head = (signed) win.getOnHead();
39 int head_left = (signed) win.screen().maxLeft(head); 52 int head_left = (signed) win.screen().maxLeft(head);
40 int head_right = (signed) win.screen().maxRight(head); 53 int head_right = (signed) win.screen().maxRight(head);
41 int head_top = (signed) win.screen().maxTop(head); 54 int head_top = (signed) win.screen().maxTop(head);
42 int head_bot = (signed) win.screen().maxBottom(head); 55 int head_bot = (signed) win.screen().maxBottom(head);
43 56
44 const ScreenPlacement &screen_placement = 57 const ScreenPlacement &screen_placement = win.screen().placementStrategy();
45 dynamic_cast<const ScreenPlacement &>(win.screen().placementStrategy());
46 58
47 bool top_bot = 59 bool top_bot =
48 screen_placement.colDirection() == ScreenPlacement::TOPBOTTOM; 60 screen_placement.colDirection() == ScreenPlacement::TOPBOTTOM;
@@ -102,6 +114,7 @@ bool RowSmartPlacement::placeWindow(const std::list<FluxboxWindow *> &windowlist
102 114
103 for (; win_it != win_it_end && placed; ++win_it) { 115 for (; win_it != win_it_end && placed; ++win_it) {
104 FluxboxWindow &window = **win_it; 116 FluxboxWindow &window = **win_it;
117 if (&window == &win) continue;
105 118
106 int curr_x = window.x() - window.xOffset(); // minus offset to get back up to fake place 119 int curr_x = window.x() - window.xOffset(); // minus offset to get back up to fake place
107 int curr_y = window.y() - window.yOffset(); 120 int curr_y = window.y() - window.yOffset();