all repos — fluxbox @ f1f7bebf3722a24f0386424cb773e647bc6f5826

custom fork of the fluxbox windowmanager

added 'ArrangeWindowsVertical' to actions
John K Pate j.k.pate at sms.ed.ac.uk
commit

f1f7bebf3722a24f0386424cb773e647bc6f5826

parent

d3eabeb805fdbd162c0743ed86a67e014e37c097

3 files changed, 28 insertions(+), 8 deletions(-)

jump to
M doc/asciidoc/fluxbox-keys.txtdoc/asciidoc/fluxbox-keys.txt

@@ -395,10 +395,12 @@

*FocusLeft* / *FocusRight* / *FocusUp* / *FocusDown*:: Focus to the next window which is located in the direction specified. -*ArrangeWindows* 'pattern':: - Tries to arrange all windows on the current workspace so that they - overlap the least amount possible. See *CLIENT PATTERNS* for more about - the 'pattern' arguments. +*ArrangeWindows* 'pattern' / *ArrangeWindowsVertical* 'pattern' / *ArrangeWindowsHorizontal* 'pattern':: + Tries to arrange all windows on the current workspace so that they overlap the + least amount possible. *ArrangeWindowsVertical* prefers vertical splits + (windows side by side), whereas *ArrangeWindowsHorizontal* prefers horizontal + splits (windows on top of eachother). See *CLIENT PATTERNS* for more about the + 'pattern' arguments. *ShowDesktop*:: Minimizes all windows on the current workspace. If they are already all
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -177,8 +177,16 @@ return new PrevWindowCmd(opts, pat);

else if (command == "prevgroup") { opts |= FocusableList::LIST_GROUPS; return new PrevWindowCmd(opts, pat); - } else if (command == "arrangewindows") - return new ArrangeWindowsCmd(pat); + } else if (command == "arrangewindows") { + int method = ArrangeWindowsCmd::UNSPECIFIED; + return new ArrangeWindowsCmd(method,pat); + } else if (command == "arrangewindowsvertical") { + int method = ArrangeWindowsCmd::VERTICAL; + return new ArrangeWindowsCmd(method,pat); + } else if (command == "arrangewindowshorizontal") { + int method = ArrangeWindowsCmd::HORIZONTAL; + return new ArrangeWindowsCmd(method,pat); + } return 0; }

@@ -188,6 +196,8 @@ REGISTER_COMMAND_PARSER(nextgroup, parseWindowList, void);

REGISTER_COMMAND_PARSER(prevwindow, parseWindowList, void); REGISTER_COMMAND_PARSER(prevgroup, parseWindowList, void); REGISTER_COMMAND_PARSER(arrangewindows, parseWindowList, void); +REGISTER_COMMAND_PARSER(arrangewindowsvertical, parseWindowList, void); +REGISTER_COMMAND_PARSER(arrangewindowshorizontal, parseWindowList, void); } // end anonymous namespace

@@ -404,7 +414,8 @@

// try to get the same number of rows as columns. unsigned int cols = int(sqrt((float)win_count)); // truncate to lower unsigned int rows = int(0.99 + float(win_count) / float(cols)); - if (max_width<max_height) { // rotate + if ( (m_tile_method == VERTICAL) || // rotate if the user has asked for it or automagically + ( (m_tile_method == UNSPECIFIED) && (max_width<max_height)) ) { std::swap(cols, rows); }
M src/WorkspaceCmd.hhsrc/WorkspaceCmd.hh

@@ -170,9 +170,16 @@

/// arranges windows in current workspace to rows and columns class ArrangeWindowsCmd: public FbTk::Command<void> { public: - ArrangeWindowsCmd(std::string &pat): m_pat(pat.c_str()) { } + enum { + UNSPECIFIED, + VERTICAL, + HORIZONTAL + }; + explicit ArrangeWindowsCmd(int tile_method, std::string &pat): + m_tile_method( tile_method ), m_pat(pat.c_str()) { } void execute(); private: + const int m_tile_method; const ClientPattern m_pat; };