aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Window.cc b/src/Window.cc
index a4eef44..f5a2fe2 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3714,10 +3714,9 @@ FluxboxWindow::ReferenceCorner FluxboxWindow::getCorner(string str) {
3714 return ERROR; 3714 return ERROR;
3715} 3715}
3716 3716
3717void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const { 3717void FluxboxWindow::translateXCoords(int &x, ReferenceCorner dir) const {
3718 int head = getOnHead(), bw = 2 * frame().window().borderWidth(), 3718 int head = getOnHead(), bw = 2 * frame().window().borderWidth(),
3719 left = screen().maxLeft(head), right = screen().maxRight(head), 3719 left = screen().maxLeft(head), right = screen().maxRight(head);
3720 top = screen().maxTop(head), bottom = screen().maxBottom(head);
3721 3720
3722 if (dir == LEFTTOP || dir == LEFT || dir == LEFTBOTTOM) 3721 if (dir == LEFTTOP || dir == LEFT || dir == LEFTBOTTOM)
3723 x += left; 3722 x += left;
@@ -3725,6 +3724,12 @@ void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const {
3725 x = right - width() - bw - x; 3724 x = right - width() - bw - x;
3726 if (dir == TOP || dir == CENTER || dir == BOTTOM) 3725 if (dir == TOP || dir == CENTER || dir == BOTTOM)
3727 x += (left + right - width() - bw)/2; 3726 x += (left + right - width() - bw)/2;
3727}
3728
3729void FluxboxWindow::translateYCoords(int &y, ReferenceCorner dir) const {
3730 int head = getOnHead(), bw = 2 * frame().window().borderWidth(),
3731 top = screen().maxTop(head), bottom = screen().maxBottom(head);
3732
3728 if (dir == LEFTTOP || dir == TOP || dir == RIGHTTOP) 3733 if (dir == LEFTTOP || dir == TOP || dir == RIGHTTOP)
3729 y += top; 3734 y += top;
3730 if (dir == LEFTBOTTOM || dir == BOTTOM || dir == RIGHTBOTTOM) 3735 if (dir == LEFTBOTTOM || dir == BOTTOM || dir == RIGHTBOTTOM)
@@ -3733,6 +3738,11 @@ void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const {
3733 y += (top + bottom - height() - bw)/2; 3738 y += (top + bottom - height() - bw)/2;
3734} 3739}
3735 3740
3741void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const {
3742 translateXCoords(x, dir);
3743 translateYCoords(y, dir);
3744}
3745
3736int FluxboxWindow::getOnHead() const { 3746int FluxboxWindow::getOnHead() const {
3737 return screen().getHead(fbWindow()); 3747 return screen().getHead(fbWindow());
3738} 3748}