aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index 834dcad..4db34c1 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -133,13 +133,33 @@ void ResizeCmd::real_execute() {
133 fbwindow().resize(w, h); 133 fbwindow().resize(w, h);
134} 134}
135 135
136MoveToCmd::MoveToCmd(const int step_size_x, const int step_size_y) : 136MoveToCmd::MoveToCmd(const int step_size_x, const int step_size_y, const unsigned int refc) :
137 m_step_size_x(step_size_x), m_step_size_y(step_size_y) { } 137 m_step_size_x(step_size_x), m_step_size_y(step_size_y), m_refc(refc) { }
138 138
139void MoveToCmd::real_execute() { 139void MoveToCmd::real_execute() {
140 fbwindow().move(m_step_size_x, m_step_size_y); 140 int x = 0;
141 int y = 0;
142
143 const int head = fbwindow().screen().getHead(fbwindow().fbWindow());
144
145 if (m_refc & MoveToCmd::LOWER)
146 y = fbwindow().screen().maxBottom(head) - fbwindow().height() - m_step_size_y;
147 if (m_refc & MoveToCmd::UPPER)
148 y = fbwindow().screen().maxTop(head) + m_step_size_y;
149 if (m_refc & MoveToCmd::RIGHT)
150 x = fbwindow().screen().maxRight(head) - fbwindow().width() - m_step_size_x;
151 if (m_refc & MoveToCmd::LEFT)
152 x = fbwindow().screen().maxLeft(head) + m_step_size_x;
153
154 if (m_refc & MoveToCmd::IGNORE_X)
155 x = fbwindow().x();
156 if (m_refc & MoveToCmd::IGNORE_Y)
157 y = fbwindow().y();
158
159 fbwindow().move(x, y);
141} 160}
142 161
162
143ResizeToCmd::ResizeToCmd(const int step_size_x, const int step_size_y) : 163ResizeToCmd::ResizeToCmd(const int step_size_x, const int step_size_y) :
144 m_step_size_x(step_size_x), m_step_size_y(step_size_y) { } 164 m_step_size_x(step_size_x), m_step_size_y(step_size_y) { }
145 165