// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-// Workspace.cc for Blackbox - an X11 Window manager
-// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh@debian.org>
-// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// 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.
#ifdef HAVE_CONFIG_H
# include "../config.h"
using std::string;
#include "blackbox.hh"
-#include "clientmenu.hh"
#include "font.hh"
-#include "netizen.hh"
#include "screen.hh"
-#include "toolbar.hh"
#include "util.hh"
#include "window.hh"
#include "workspace.hh"
-#include "windowmenu.hh"
#include "xatom.hh"
id = i;
- clientmenu = new Clientmenu(this);
-
lastfocus = (BlackboxWindow *) 0;
readName();
windowList.push_back(w);
- clientmenu->insert(w->getTitle());
- clientmenu->update();
-
- if (! sticky)
- screen->updateNetizenWindowAdd(w->getClientWindow(), id);
-
if (screen->doFocusNew() || (w->isTransient() && w->getTransientFor() &&
w->getTransientFor()->isFocused())) {
if (id != screen->getCurrentWorkspaceID()) {
assert(it != end);
windowList.erase(it);
- clientmenu->remove(i);
- clientmenu->update();
-
if (! sticky) {
- screen->updateNetizenWindowDel(w->getClientWindow());
-
BlackboxWindowList::iterator it = windowList.begin();
const BlackboxWindowList::iterator end = windowList.end();
unsigned int i = 0;
}
-void Workspace::setFocused(const BlackboxWindow *w, bool focused) {
- BlackboxWindowList::iterator it, end = windowList.end();
- int i;
- for (i = 0, it = windowList.begin(); it != end; ++it, ++i)
- if (*it == w)
- break;
- // if its == end, then a window thats not in the windowList
- // got focused, such as a !isNormal() window.
- if (it != end)
- clientmenu->setItemSelected(i, focused);
-}
-
-
void Workspace::removeAll(void) {
while (! windowList.empty())
windowList.front()->iconify();
for (it = win->getTransients().begin(); it != end; ++it) {
BlackboxWindow *w = *it;
*stack++ = w->getFrameWindow();
- screen->updateNetizenWindowRaise(w->getClientWindow());
if (! w->isIconic()) {
Workspace *wkspc = screen->getWorkspace(w->getWorkspaceNumber());
for (it = win->getTransients().rbegin(); it != end; ++it) {
BlackboxWindow *w = *it;
*stack++ = w->getFrameWindow();
- screen->updateNetizenWindowLower(w->getClientWindow());
if (! w->isIconic()) {
Workspace *wkspc = screen->getWorkspace(w->getWorkspaceNumber());
StackVector::iterator stack = stack_vector.begin();
*(stack++) = win->getFrameWindow();
- screen->updateNetizenWindowRaise(win->getClientWindow());
if (! (win->isIconic() || win->isDesktop())) {
Workspace *wkspc = screen->getWorkspace(win->getWorkspaceNumber());
wkspc->stackingList.remove(win);
lowerTransients(win, stack);
*(stack++) = win->getFrameWindow();
- screen->updateNetizenWindowLower(win->getClientWindow());
if (! (win->isIconic() || win->isDesktop())) {
Workspace *wkspc = screen->getWorkspace(win->getWorkspaceNumber());
wkspc->stackingList.remove(win);
void Workspace::reconfigure(void) {
- clientmenu->reconfigure();
std::for_each(windowList.begin(), windowList.end(),
std::mem_fun(&BlackboxWindow::reconfigure));
}
}
-void Workspace::sendWindowList(Netizen &n) {
- BlackboxWindowList::iterator it = windowList.begin(),
- end = windowList.end();
- for(; it != end; ++it)
- n.sendWindowAdd((*it)->getClientWindow(), getID());
-}
-
-
unsigned int Workspace::getCount(void) const {
return windowList.size();
}
namesList.size() > id) {
name = namesList[id];
- clientmenu->setLabel(name);
- clientmenu->update();
} else {
/*
Use a default name. This doesn't actually change the class. That will
happen after the setName changes the root property, and that change
makes its way back to this function.
*/
- string tmp =i18n(WorkspaceSet, WorkspaceDefaultNameFormat,
- "Workspace %d");
+ string tmp = "Workspace %d";
assert(tmp.length() < 32);
char default_name[32];
sprintf(default_name, tmp.c_str(), id + 1);