all repos — fluxbox @ 0688816d11e1fbd5576197f39f949ead687101d9

custom fork of the fluxbox windowmanager

add window pattern argument to ArrangeWindows
Mark Tiefenbruck mark@fluxbox.org
commit

0688816d11e1fbd5576197f39f949ead687101d9

parent

1be92e79eca2ef3b9c99655302ac5d1c0d91e14b

3 files changed, 16 insertions(+), 12 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.1 +*08/08/04: + * Add window list argument to ArrangeWindows (Mark) + WorkspaceCmd.cc/hh *08/06/26: * Remove antiquated dithering code (Mark) FbTk/ImageControl.cc/hh FbTk/TextureRender.cc Screen.cc/hh
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -173,7 +173,8 @@ 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); return 0; }

@@ -182,6 +183,7 @@ REGISTER_COMMAND_PARSER(nextwindow, parseWindowList, void);

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

@@ -353,8 +355,6 @@ screen->changeWorkspaceID(actual);

} } -REGISTER_COMMAND(arrangewindows, ArrangeWindowsCmd, void); - /** try to arrange the windows on the current workspace in a 'clever' way. we take the shaded-windows and put them ontop of the workspace and put the

@@ -366,9 +366,8 @@ if (screen == 0)

return; Workspace *space = screen->currentWorkspace(); - size_t win_count = space->windowList().size(); - if (win_count == 0) + if (space->windowList().empty()) return; // TODO: choice between

@@ -382,19 +381,18 @@ Workspace::Windows normal_windows;

Workspace::Windows shaded_windows; for(win = space->windowList().begin(); win != space->windowList().end(); win++) { int winhead = screen->getHead((*win)->fbWindow()); - if (winhead == head || winhead == 0) { - if (!(*win)->isShaded()) - normal_windows.push_back(*win); - else + if ((winhead == head || winhead == 0) && m_pat.match(**win)) { + if ((*win)->isShaded()) shaded_windows.push_back(*win); + else + normal_windows.push_back(*win); } } // to arrange only shaded windows is a bit pointless imho (mathias) - if (normal_windows.size() == 0) + size_t win_count = normal_windows.size(); + if (win_count == 0) return; - - win_count = normal_windows.size(); const unsigned int max_width = screen->maxRight(head) - screen->maxLeft(head); unsigned int max_height = screen->maxBottom(head) - screen->maxTop(head);
M src/WorkspaceCmd.hhsrc/WorkspaceCmd.hh

@@ -170,7 +170,10 @@

/// 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()) { } void execute(); +private: + const ClientPattern m_pat; }; class ShowDesktopCmd: public FbTk::Command<void> {