diff options
author | markt <markt> | 2007-10-24 17:09:26 (GMT) |
---|---|---|
committer | markt <markt> | 2007-10-24 17:09:26 (GMT) |
commit | f3afe787c1209cf1357493924a4f7eb7864def54 (patch) | |
tree | d0c0c3eca154ab538fbc1fb3c62081e9250c05bd /src/ColSmartPlacement.cc | |
parent | 74eb584a312aba21b21eccb6c49ade1571aa3740 (diff) | |
download | fluxbox-f3afe787c1209cf1357493924a4f7eb7864def54.zip fluxbox-f3afe787c1209cf1357493924a4f7eb7864def54.tar.bz2 |
introduced workspacename for ClientPattern, and some miscellaneous cleanup
Diffstat (limited to 'src/ColSmartPlacement.cc')
-rw-r--r-- | src/ColSmartPlacement.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ColSmartPlacement.cc b/src/ColSmartPlacement.cc index 995a2f9..bdffa41 100644 --- a/src/ColSmartPlacement.cc +++ b/src/ColSmartPlacement.cc | |||
@@ -23,16 +23,29 @@ | |||
23 | 23 | ||
24 | #include "ColSmartPlacement.hh" | 24 | #include "ColSmartPlacement.hh" |
25 | 25 | ||
26 | #include "FocusControl.hh" | ||
26 | #include "Screen.hh" | 27 | #include "Screen.hh" |
27 | #include "ScreenPlacement.hh" | 28 | #include "ScreenPlacement.hh" |
28 | #include "Window.hh" | 29 | #include "Window.hh" |
29 | 30 | ||
30 | bool ColSmartPlacement::placeWindow(const std::list<FluxboxWindow *> &windowlist, | 31 | bool ColSmartPlacement::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 | // xinerama head constraints | 48 | // xinerama head constraints |
35 | int head = (signed) win.getOnHead(); | ||
36 | int head_left = (signed) win.screen().maxLeft(head); | 49 | int head_left = (signed) win.screen().maxLeft(head); |
37 | int head_right = (signed) win.screen().maxRight(head); | 50 | int head_right = (signed) win.screen().maxRight(head); |
38 | int head_top = (signed) win.screen().maxTop(head); | 51 | int head_top = (signed) win.screen().maxTop(head); |
@@ -40,8 +53,7 @@ bool ColSmartPlacement::placeWindow(const std::list<FluxboxWindow *> &windowlist | |||
40 | 53 | ||
41 | bool placed = false; | 54 | bool placed = false; |
42 | int next_x, next_y; | 55 | int next_x, next_y; |
43 | const ScreenPlacement &screen_placement = | 56 | const ScreenPlacement &screen_placement = win.screen().placementStrategy(); |
44 | dynamic_cast<const ScreenPlacement &>(win.screen().placementStrategy()); | ||
45 | 57 | ||
46 | bool top_bot = screen_placement.colDirection() == ScreenPlacement::TOPBOTTOM; | 58 | bool top_bot = screen_placement.colDirection() == ScreenPlacement::TOPBOTTOM; |
47 | bool left_right = screen_placement.rowDirection() == ScreenPlacement::LEFTRIGHT; | 59 | bool left_right = screen_placement.rowDirection() == ScreenPlacement::LEFTRIGHT; |
@@ -90,6 +102,7 @@ bool ColSmartPlacement::placeWindow(const std::list<FluxboxWindow *> &windowlist | |||
90 | std::list<FluxboxWindow *>::const_iterator it_end = | 102 | std::list<FluxboxWindow *>::const_iterator it_end = |
91 | windowlist.end(); | 103 | windowlist.end(); |
92 | for (; it != it_end && placed; ++it) { | 104 | for (; it != it_end && placed; ++it) { |
105 | if (*it == &win) continue; | ||
93 | int curr_x = (*it)->x() - (*it)->xOffset(); | 106 | int curr_x = (*it)->x() - (*it)->xOffset(); |
94 | int curr_y = (*it)->y() - (*it)->yOffset(); | 107 | int curr_y = (*it)->y() - (*it)->yOffset(); |
95 | int curr_w = (*it)->width() + (*it)->fbWindow().borderWidth()*2 + (*it)->widthOffset(); | 108 | int curr_w = (*it)->width() + (*it)->fbWindow().borderWidth()*2 + (*it)->widthOffset(); |