all repos — fluxbox @ 6a609280facaf0a3ba395f37b0115a339002b4a5

custom fork of the fluxbox windowmanager

new workspace stack and removeWindow function
fluxgen fluxgen
commit

6a609280facaf0a3ba395f37b0115a339002b4a5

parent

ebcea1ff9286f7164baf550f07d7fc837ed9ef51

1 files changed, 28 insertions(+), 16 deletions(-)

jump to
M src/Screen.ccsrc/Screen.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: Screen.cc,v 1.66 2002/09/07 20:22:08 fluxgen Exp $ +// $Id: Screen.cc,v 1.67 2002/09/08 19:45:59 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -390,7 +390,7 @@ #endif // SLIT

initMenu(); - raiseWindows(0, 0); + raiseWindows(Workspace::Stack()); //update menus rootmenu->update();

@@ -620,7 +620,7 @@

{ int remember_sub = rootmenu->currentSubmenu(); initMenu(); - raiseWindows(0, 0); + raiseWindows(Workspace::Stack()); rootmenu->reconfigure(); rootmenu->drawSubmenu(remember_sub); }

@@ -653,7 +653,7 @@

void BScreen::rereadMenu() { initMenu(); - raiseWindows(0, 0); + raiseWindows(Workspace::Stack()); rootmenu->reconfigure(); }

@@ -683,7 +683,8 @@ }

void BScreen::removeIcon(FluxboxWindow *w) { - if (! w) return; + if (! w) + return; { Icons::iterator it = iconList.begin();

@@ -707,6 +708,13 @@ (*it)->setWindowNumber(i);

} } +void BScreen::removeWindow(FluxboxWindow *win) { + Workspaces::iterator it = workspacesList.begin(); + Workspaces::iterator it_end = workspacesList.end(); + for (; it != it_end; ++it) { + (*it)->removeWindow(win); + } +} FluxboxWindow *BScreen::getIcon(unsigned int index) { if (index < iconList.size())

@@ -975,9 +983,9 @@ }

} -void BScreen::raiseWindows(Window *workspace_stack, int num) { +void BScreen::raiseWindows(const Workspace::Stack &workspace_stack) { - Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)]; + Window session_stack[(workspace_stack.size() + workspacesList.size() + rootmenuList.size() + 30)]; int i = 0; XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->windowID()); session_stack[i++] = iconmenu->windowID();

@@ -1029,10 +1037,12 @@ #ifdef SLIT

if (slit->isOnTop()) session_stack[i++] = slit->getWindowID(); #endif // SLIT - - int k=num; - while (k--) - session_stack[i++] = *(workspace_stack + k); + if (!workspace_stack.empty()) { + Workspace::Stack::const_reverse_iterator it = workspace_stack.rbegin(); + Workspace::Stack::const_reverse_iterator it_end = workspace_stack.rend(); + for (; it != it_end; ++it) + session_stack[i++] = (*it); + } XRestackWindows(getBaseDisplay()->getXDisplay(), session_stack, i);

@@ -1095,10 +1105,10 @@

void BScreen::nextFocus(int opts) { bool have_focused = false; int focused_window_number = -1; - FluxboxWindow *focused; + FluxboxWindow *focused = fluxbox->getFocusedWindow(); const int num_windows = getCurrentWorkspace()->getCount(); - if ((focused = fluxbox->getFocusedWindow())) { + if (focused != 0) { if (focused->getScreen()->getScreenNumber() == getScreenNumber()) { have_focused = true;

@@ -1108,9 +1118,11 @@ }

if (num_windows > 1 && have_focused) { Workspace *wksp = getCurrentWorkspace(); - Workspace::Windows wins = wksp->getWindowList(); + Workspace::Windows &wins = wksp->getWindowList(); Workspace::Windows::iterator it = wins.begin(); - for (; *it != focused; ++it); //get focused window iterator + + for (; *it != focused; ++it) //get focused window iterator + continue; do { ++it;

@@ -1121,7 +1133,7 @@ if (! (doSkipWindow(*it, opts) || !(*it)->setInputFocus()) )

break; } while (*it != focused); - if (*it != focused) + if (*it != focused && it != wins.end()) wksp->raiseWindow(*it); } else if (num_windows >= 1) {