summaryrefslogtreecommitdiff
path: root/src/MinOverlapPlacement.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-10-24 17:09:26 (GMT)
committermarkt <markt>2007-10-24 17:09:26 (GMT)
commitf3afe787c1209cf1357493924a4f7eb7864def54 (patch)
treed0c0c3eca154ab538fbc1fb3c62081e9250c05bd /src/MinOverlapPlacement.cc
parent74eb584a312aba21b21eccb6c49ade1571aa3740 (diff)
downloadfluxbox_lack-f3afe787c1209cf1357493924a4f7eb7864def54.zip
fluxbox_lack-f3afe787c1209cf1357493924a4f7eb7864def54.tar.bz2
introduced workspacename for ClientPattern, and some miscellaneous cleanup
Diffstat (limited to 'src/MinOverlapPlacement.cc')
-rw-r--r--src/MinOverlapPlacement.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/MinOverlapPlacement.cc b/src/MinOverlapPlacement.cc
index 68301c6..510f66e 100644
--- a/src/MinOverlapPlacement.cc
+++ b/src/MinOverlapPlacement.cc
@@ -23,6 +23,7 @@
23 23
24#include "MinOverlapPlacement.hh" 24#include "MinOverlapPlacement.hh"
25 25
26#include "FocusControl.hh"
26#include "Window.hh" 27#include "Window.hh"
27#include "Screen.hh" 28#include "Screen.hh"
28 29
@@ -34,19 +35,30 @@ MinOverlapPlacement::MinOverlapPlacement(ScreenPlacement::PlacementPolicy policy
34 s_policy = policy; 35 s_policy = policy;
35} 36}
36 37
37bool MinOverlapPlacement::placeWindow( 38bool MinOverlapPlacement::placeWindow(const FluxboxWindow &win, int head,
38 const std::list<FluxboxWindow *> &windowlist, 39 int &place_x, int &place_y) {
39 const FluxboxWindow &win, int &place_x, int &place_y) { 40
41 std::list<FluxboxWindow *> windowlist;
42 const std::list<Focusable *> focusables =
43 win.screen().focusControl().focusedOrderWinList();
44 std::list<Focusable *>::const_iterator foc_it = focusables.begin(),
45 foc_it_end = focusables.end();
46 unsigned int workspace = win.workspaceNumber();
47 for (; foc_it != foc_it_end; ++foc_it) {
48 // make sure it's a FluxboxWindow
49 if (*foc_it == (*foc_it)->fbwindow() &&
50 (workspace == (*foc_it)->fbwindow()->workspaceNumber() ||
51 (*foc_it)->fbwindow()->isStuck()))
52 windowlist.push_back((*foc_it)->fbwindow());
53 }
40 54
41 // view (screen + head) constraints 55 // view (screen + head) constraints
42 int head = (signed) win.getOnHead();
43 int head_left = (signed) win.screen().maxLeft(head); 56 int head_left = (signed) win.screen().maxLeft(head);
44 int head_right = (signed) win.screen().maxRight(head); 57 int head_right = (signed) win.screen().maxRight(head);
45 int head_top = (signed) win.screen().maxTop(head); 58 int head_top = (signed) win.screen().maxTop(head);
46 int head_bot = (signed) win.screen().maxBottom(head); 59 int head_bot = (signed) win.screen().maxBottom(head);
47 60
48 const ScreenPlacement &screen_placement = 61 const ScreenPlacement &screen_placement = win.screen().placementStrategy();
49 dynamic_cast<const ScreenPlacement &>(win.screen().placementStrategy());
50 s_row_dir = screen_placement.rowDirection(); 62 s_row_dir = screen_placement.rowDirection();
51 s_col_dir = screen_placement.colDirection(); 63 s_col_dir = screen_placement.colDirection();
52 64
@@ -70,6 +82,7 @@ bool MinOverlapPlacement::placeWindow(
70 std::list<FluxboxWindow *>::const_reverse_iterator it = windowlist.rbegin(), 82 std::list<FluxboxWindow *>::const_reverse_iterator it = windowlist.rbegin(),
71 it_end = windowlist.rend(); 83 it_end = windowlist.rend();
72 for (; it != it_end; ++it) { 84 for (; it != it_end; ++it) {
85 if (*it == &win) continue;
73 86
74 // get the dimensions of the window 87 // get the dimensions of the window
75 int left = (*it)->x() - (*it)->xOffset(); 88 int left = (*it)->x() - (*it)->xOffset();