aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/MinOverlapPlacement.cc28
-rw-r--r--src/ScreenPlacement.cc9
-rw-r--r--src/ScreenResources.cc4
3 files changed, 24 insertions, 17 deletions
diff --git a/src/MinOverlapPlacement.cc b/src/MinOverlapPlacement.cc
index 1ace23a..e7e80cb 100644
--- a/src/MinOverlapPlacement.cc
+++ b/src/MinOverlapPlacement.cc
@@ -72,12 +72,14 @@ bool MinOverlapPlacement::placeWindow(
72 for (; it != it_end; ++it) { 72 for (; it != it_end; ++it) {
73 73
74 // get the dimensions of the window 74 // get the dimensions of the window
75 int bottom = (*it)->y() + (*it)->height() + 75 int left = (*it)->x() - (*it)->xOffset();
76 2*(*it)->frame().window().borderWidth(); 76 int top = (*it)->y() - (*it)->yOffset();
77 int top = (*it)->y(); 77 int right = left + (*it)->width() +
78 int right = (*it)->x() + (*it)->width() + 78 2*(*it)->frame().window().borderWidth() +
79 2*(*it)->frame().window().borderWidth(); 79 (*it)->widthOffset();
80 int left = (*it)->x(); 80 int bottom = top + (*it)->height() +
81 2*(*it)->frame().window().borderWidth() +
82 (*it)->heightOffset();
81 83
82 // go through the list of regions 84 // go through the list of regions
83 // if this window overlaps that region and the new window still fits, 85 // if this window overlaps that region and the new window still fits,
@@ -143,12 +145,14 @@ bool MinOverlapPlacement::placeWindow(
143 for (; it != windowlist.rend(); ++it) { 145 for (; it != windowlist.rend(); ++it) {
144 146
145 // get the dimensions of the window 147 // get the dimensions of the window
146 int bottom = (*it)->y() + (*it)->height() + 148 int left = (*it)->x() - (*it)->xOffset();
147 2*(*it)->frame().window().borderWidth(); 149 int top = (*it)->y() - (*it)->yOffset();
148 int top = (*it)->y(); 150 int right = left + (*it)->width() +
149 int right = (*it)->x() + (*it)->width() + 151 2*(*it)->frame().window().borderWidth() +
150 2*(*it)->frame().window().borderWidth(); 152 (*it)->widthOffset();
151 int left = (*it)->x(); 153 int bottom = top + (*it)->height() +
154 2*(*it)->frame().window().borderWidth() +
155 (*it)->heightOffset();
152 156
153 // get the coordinates of the overlap region 157 // get the coordinates of the overlap region
154 int min_right = (right > reg_it->x + win_w) ? 158 int min_right = (right > reg_it->x + win_w) ?
diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
index fb79d88..85f2487 100644
--- a/src/ScreenPlacement.cc
+++ b/src/ScreenPlacement.cc
@@ -123,10 +123,11 @@ bool ScreenPlacement::placeWindow(const std::list<FluxboxWindow *> &windowlist,
123 win_h = win.height() + win.fbWindow().borderWidth()*2 + win.heightOffset(); 123 win_h = win.height() + win.fbWindow().borderWidth()*2 + win.heightOffset();
124 124
125 // make sure the window is inside our screen(head) area 125 // make sure the window is inside our screen(head) area
126 if (place_x + win_w > head_right) 126 if (place_x + win_w - win.xOffset() > head_right)
127 place_x = (head_right - win_w) / 2 + win.xOffset(); 127 place_x = head_left + (head_right - head_left - win_w) / 2 +
128 if (place_y + win_h > head_bot) 128 win.xOffset();
129 place_y = (head_bot - win_h) / 2 + win.yOffset(); 129 if (place_y + win_h - win.yOffset() > head_bot)
130 place_y = head_top + (head_bot - head_top - win_h) / 2 + win.yOffset();
130 131
131 return true; 132 return true;
132} 133}
diff --git a/src/ScreenResources.cc b/src/ScreenResources.cc
index 0f17c2a..8b71505 100644
--- a/src/ScreenResources.cc
+++ b/src/ScreenResources.cc
@@ -84,6 +84,7 @@ template<>
84string FbTk::Resource<BScreen::FollowModel>::getString() const { 84string FbTk::Resource<BScreen::FollowModel>::getString() const {
85 switch (m_value) { 85 switch (m_value) {
86 case BScreen::FOLLOW_ACTIVE_WINDOW: 86 case BScreen::FOLLOW_ACTIVE_WINDOW:
87 default:
87 return string("Follow"); 88 return string("Follow");
88 break; 89 break;
89 case BScreen::FETCH_ACTIVE_WINDOW: 90 case BScreen::FETCH_ACTIVE_WINDOW:
@@ -93,7 +94,6 @@ string FbTk::Resource<BScreen::FollowModel>::getString() const {
93 return string("SemiFollow"); 94 return string("SemiFollow");
94 break; 95 break;
95 case BScreen::IGNORE_OTHER_WORKSPACES: 96 case BScreen::IGNORE_OTHER_WORKSPACES:
96 default:
97 return string("Ignore"); 97 return string("Ignore");
98 break; 98 break;
99 } 99 }
@@ -111,6 +111,8 @@ setFromString(char const *strval) {
111 m_value = BScreen::FETCH_ACTIVE_WINDOW; 111 m_value = BScreen::FETCH_ACTIVE_WINDOW;
112 else if (strcasecmp(strval, "SemiFollow") == 0) 112 else if (strcasecmp(strval, "SemiFollow") == 0)
113 m_value = BScreen::SEMIFOLLOW_ACTIVE_WINDOW; 113 m_value = BScreen::SEMIFOLLOW_ACTIVE_WINDOW;
114 else if (strcasecmp(strval, "Ignore") == 0)
115 m_value = BScreen::IGNORE_OTHER_WORKSPACES;
114 else 116 else
115 setDefaultValue(); 117 setDefaultValue();
116} 118}