aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-05-17 18:27:55 (GMT)
committermarkt <markt>2007-05-17 18:27:55 (GMT)
commitb4992602de1c6552125112ea14073e915e19810b (patch)
tree4214e2f0a0a64b4708984a78a93be37130adc191
parentab50be07b8a439710ca561a791629b541908330e (diff)
downloadfluxbox-b4992602de1c6552125112ea14073e915e19810b.zip
fluxbox-b4992602de1c6552125112ea14073e915e19810b.tar.bz2
fixed some window placement issues
-rw-r--r--ChangeLog3
-rw-r--r--src/MinOverlapPlacement.cc28
-rw-r--r--src/ScreenPlacement.cc9
-rw-r--r--src/ScreenResources.cc4
4 files changed, 27 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index a64421f..22f73c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1: 2Changes for 1.1:
3*07/05/17:
4 * Fixed some window placement issues (thanks Tomas Janousek)
5 ScreenPlacement.cc
3*07/05/16: 6*07/05/16:
4 * Added new resource session.screen<N>.noFocusWhileTypingDelay: <int> (Mark) 7 * Added new resource session.screen<N>.noFocusWhileTypingDelay: <int> (Mark)
5 - specifies a time in milliseconds that new windows should not gain focus 8 - specifies a time in milliseconds that new windows should not gain focus
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}