really fix placeWindow

This commit is contained in:
rathnor 2004-03-15 23:36:13 +00:00
parent 1d58e3afb2
commit ca9f484883
2 changed files with 18 additions and 12 deletions

View file

@ -1,5 +1,8 @@
(Format: Year/Month/Day) (Format: Year/Month/Day)
Changes for 0.9.9: Changes for 0.9.9:
*04/03/16:
* Fix the fix, and a bit more for placeWindow (Simon)
Workspace.cc
*04/03/15: *04/03/15:
* bug in placeWindow caused spinning with screens higher than width * bug in placeWindow caused spinning with screens higher than width
e.g. vertical xinerama (Simon) e.g. vertical xinerama (Simon)

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Workspace.cc,v 1.93 2004/03/15 03:48:47 rathnor Exp $ // $Id: Workspace.cc,v 1.94 2004/03/15 23:36:13 rathnor Exp $
#include "Workspace.hh" #include "Workspace.hh"
@ -489,22 +489,25 @@ void Workspace::placeWindow(FluxboxWindow &win) {
test_y = head_bot - win_h; test_y = head_bot - win_h;
while (!placed && while (!placed &&
(top_bot ? test_y + win_h < head_bot (top_bot ? test_y + win_h <= head_bot
: test_y > head_top)) { : test_y >= head_top)) {
if (left_right) if (left_right)
test_x = head_left; test_x = head_left;
else else
test_x = head_right - win_w; test_x = head_right - win_w;
// The trick here is that we set it to the furthest away one,
// then the code brings it back down to the safest one that
// we can go to (i.e. the next untested area)
if (top_bot) if (top_bot)
next_y = head_top; next_y = head_bot; // will be shrunk
else else
next_y = head_bot - win_h; // will be shrunk next_y = head_top-1;
while (!placed && while (!placed &&
(left_right ? test_x + win_w < head_right (left_right ? test_x + win_w <= head_right
: test_x > head_left)) { : test_x >= head_left)) {
placed = true; placed = true;
@ -578,13 +581,13 @@ void Workspace::placeWindow(FluxboxWindow &win) {
test_x = head_right - win_w; test_x = head_right - win_w;
while (!placed && while (!placed &&
(left_right ? test_x + win_w < head_right (left_right ? test_x + win_w <= head_right
: test_x > head_left)) { : test_x >= head_left)) {
if (left_right) if (left_right)
next_x = head_right; // it will get shrunk next_x = head_right; // it will get shrunk
else else
next_x = head_left; next_x = head_left-1;
if (top_bot) if (top_bot)
test_y = head_top; test_y = head_top;
@ -592,8 +595,8 @@ void Workspace::placeWindow(FluxboxWindow &win) {
test_y = head_bot - win_h; test_y = head_bot - win_h;
while (!placed && while (!placed &&
(top_bot ? test_y + win_h < head_bot (top_bot ? test_y + win_h <= head_bot
: test_y > head_top)) { : test_y >= head_top)) {
placed = True; placed = True;
next_y = test_y + change_y; next_y = test_y + change_y;