all repos — fluxbox @ 11324be64f2ee9f2a1b8dc1e9b1e92fa520d243e

custom fork of the fluxbox windowmanager

add new window after the last focused
fluxgen fluxgen
commit

11324be64f2ee9f2a1b8dc1e9b1e92fa520d243e

parent

0dfac0a9997e8bd9ba51b003ee7666202eaa5bbf

1 files changed, 27 insertions(+), 3 deletions(-)

jump to
M src/Workspace.ccsrc/Workspace.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.14 2002/03/23 15:14:45 fluxgen Exp $ +// $Id: Workspace.cc,v 1.15 2002/04/02 23:14:07 fluxgen Exp $ // use GNU extensions #ifndef _GNU_SOURCE

@@ -98,7 +98,22 @@ w->setWorkspace(id);

w->setWindowNumber(windowList.size()); stackingList.push_front(w); - windowList.push_back(w); + + //insert window after the currently focused window + FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow(); + //if there isn't any window that's focused, just add it to the end of the list + if (focused == 0) { + windowList.push_back(w); + } else { + Windows::iterator it = windowList.begin(); + for (; it != windowList.end(); ++it) { + if (*it == focused) { + ++it; + break; + } + } + windowList.insert(it, w); + } clientmenu->insert(w->getTitle()); clientmenu->update();

@@ -139,7 +154,16 @@

if (lastfocus == w) lastfocus = (FluxboxWindow *) 0; - windowList.erase(windowList.begin() + w->getWindowNumber()); + //could be faster? + Windows::iterator it = windowList.begin(); + Windows::iterator it_end = windowList.end(); + for (; it != it_end; ++it) { + if (*it == w) { + windowList.erase(it); + break; + } + } + clientmenu->remove(w->getWindowNumber()); clientmenu->update();