aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r--src/WorkspaceCmd.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 6267671..168a56d 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -177,8 +177,16 @@ FbTk::Command<void> *parseWindowList(const string &command,
177 else if (command == "prevgroup") { 177 else if (command == "prevgroup") {
178 opts |= FocusableList::LIST_GROUPS; 178 opts |= FocusableList::LIST_GROUPS;
179 return new PrevWindowCmd(opts, pat); 179 return new PrevWindowCmd(opts, pat);
180 } else if (command == "arrangewindows") 180 } else if (command == "arrangewindows") {
181 return new ArrangeWindowsCmd(pat); 181 int method = ArrangeWindowsCmd::UNSPECIFIED;
182 return new ArrangeWindowsCmd(method,pat);
183 } else if (command == "arrangewindowsvertical") {
184 int method = ArrangeWindowsCmd::VERTICAL;
185 return new ArrangeWindowsCmd(method,pat);
186 } else if (command == "arrangewindowshorizontal") {
187 int method = ArrangeWindowsCmd::HORIZONTAL;
188 return new ArrangeWindowsCmd(method,pat);
189 }
182 return 0; 190 return 0;
183} 191}
184 192
@@ -188,6 +196,8 @@ REGISTER_COMMAND_PARSER(nextgroup, parseWindowList, void);
188REGISTER_COMMAND_PARSER(prevwindow, parseWindowList, void); 196REGISTER_COMMAND_PARSER(prevwindow, parseWindowList, void);
189REGISTER_COMMAND_PARSER(prevgroup, parseWindowList, void); 197REGISTER_COMMAND_PARSER(prevgroup, parseWindowList, void);
190REGISTER_COMMAND_PARSER(arrangewindows, parseWindowList, void); 198REGISTER_COMMAND_PARSER(arrangewindows, parseWindowList, void);
199REGISTER_COMMAND_PARSER(arrangewindowsvertical, parseWindowList, void);
200REGISTER_COMMAND_PARSER(arrangewindowshorizontal, parseWindowList, void);
191 201
192} // end anonymous namespace 202} // end anonymous namespace
193 203
@@ -404,7 +414,8 @@ void ArrangeWindowsCmd::execute() {
404 // try to get the same number of rows as columns. 414 // try to get the same number of rows as columns.
405 unsigned int cols = int(sqrt((float)win_count)); // truncate to lower 415 unsigned int cols = int(sqrt((float)win_count)); // truncate to lower
406 unsigned int rows = int(0.99 + float(win_count) / float(cols)); 416 unsigned int rows = int(0.99 + float(win_count) / float(cols));
407 if (max_width<max_height) { // rotate 417 if ( (m_tile_method == VERTICAL) || // rotate if the user has asked for it or automagically
418 ( (m_tile_method == UNSPECIFIED) && (max_width<max_height)) ) {
408 std::swap(cols, rows); 419 std::swap(cols, rows);
409 } 420 }
410 421