update from Workspace changes
This commit is contained in:
parent
bd7951bcda
commit
46e9b6e546
7 changed files with 36 additions and 35 deletions
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Screen.cc,v 1.44 2002/04/08 22:26:25 fluxgen Exp $
|
||||
// $Id: Screen.cc,v 1.45 2002/04/09 23:15:21 fluxgen Exp $
|
||||
|
||||
//use GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -371,12 +371,12 @@ resource(rm, screenname, altscreenname)
|
|||
for (int i = 0; i < *resource.workspaces; ++i) {
|
||||
wkspc = new Workspace(this, workspacesList.size());
|
||||
workspacesList.push_back(wkspc);
|
||||
workspacemenu->insert(wkspc->getName(), wkspc->getMenu());
|
||||
workspacemenu->insert(wkspc->name().c_str(), wkspc->menu());
|
||||
}
|
||||
} else {
|
||||
wkspc = new Workspace(this, workspacesList.size());
|
||||
workspacesList.push_back(wkspc);
|
||||
workspacemenu->insert(wkspc->getName(), wkspc->getMenu());
|
||||
workspacemenu->insert(wkspc->name().c_str(), wkspc->menu());
|
||||
}
|
||||
|
||||
workspacemenu->insert(i18n->
|
||||
|
@ -720,8 +720,8 @@ int BScreen::addWorkspace(void) {
|
|||
Workspace *wkspc = new Workspace(this, workspacesList.size());
|
||||
workspacesList.push_back(wkspc);
|
||||
//add workspace to workspacemenu
|
||||
workspacemenu->insert(wkspc->getName(), wkspc->getMenu(),
|
||||
wkspc->getWorkspaceID() + 2); //+2 so we add it after "remove last"
|
||||
workspacemenu->insert(wkspc->name().c_str(), wkspc->menu(),
|
||||
wkspc->workspaceID() + 2); //+2 so we add it after "remove last"
|
||||
|
||||
workspacemenu->update();
|
||||
saveWorkspaces(workspacesList.size());
|
||||
|
@ -739,12 +739,12 @@ int BScreen::removeLastWorkspace(void) {
|
|||
if (workspacesList.size() > 1) {
|
||||
Workspace *wkspc = workspacesList.back();
|
||||
|
||||
if (current_workspace->getWorkspaceID() == wkspc->getWorkspaceID())
|
||||
changeWorkspaceID(current_workspace->getWorkspaceID() - 1);
|
||||
if (current_workspace->workspaceID() == wkspc->workspaceID())
|
||||
changeWorkspaceID(current_workspace->workspaceID() - 1);
|
||||
|
||||
wkspc->removeAll();
|
||||
|
||||
workspacemenu->remove(wkspc->getWorkspaceID()+2); // + 2 is where workspaces starts
|
||||
workspacemenu->remove(wkspc->workspaceID()+2); // + 2 is where workspaces starts
|
||||
workspacemenu->update();
|
||||
|
||||
//remove last workspace
|
||||
|
@ -766,12 +766,12 @@ void BScreen::changeWorkspaceID(unsigned int id) {
|
|||
if (! current_workspace || id >= workspacesList.size())
|
||||
return;
|
||||
|
||||
if (id != current_workspace->getWorkspaceID()) {
|
||||
if (id != current_workspace->workspaceID()) {
|
||||
XSync(fluxbox->getXDisplay(), true);
|
||||
|
||||
current_workspace->hideAll();
|
||||
|
||||
workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, false);
|
||||
workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false);
|
||||
|
||||
if (fluxbox->getFocusedWindow() &&
|
||||
fluxbox->getFocusedWindow()->getScreen() == this &&
|
||||
|
@ -784,7 +784,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
|
|||
|
||||
current_workspace = getWorkspace(id);
|
||||
|
||||
workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, true);
|
||||
workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true);
|
||||
toolbar->redrawWorkspaceLabel(true);
|
||||
|
||||
current_workspace->showAll();
|
||||
|
@ -803,7 +803,7 @@ void BScreen::sendToWorkspace(unsigned int id, bool changeWS) {
|
|||
if (! current_workspace || id >= workspacesList.size())
|
||||
return;
|
||||
|
||||
if (id != current_workspace->getWorkspaceID()) {
|
||||
if (id != current_workspace->workspaceID()) {
|
||||
XSync(fluxbox->getXDisplay(), True);
|
||||
|
||||
win = fluxbox->getFocusedWindow();
|
||||
|
@ -840,7 +840,7 @@ void BScreen::addNetizen(Netizen *n) {
|
|||
for (; it != it_end; ++it) {
|
||||
for (int i = 0; i < (*it)->getCount(); ++i) {
|
||||
n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(),
|
||||
(*it)->getWorkspaceID());
|
||||
(*it)->workspaceID());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -990,7 +990,7 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) {
|
|||
Workspaces::iterator wit = workspacesList.begin();
|
||||
Workspaces::iterator wit_end = workspacesList.end();
|
||||
for (; wit != wit_end; ++wit) {
|
||||
session_stack[i++] = (*wit)->getMenu()->windowID();
|
||||
session_stack[i++] = (*wit)->menu()->windowID();
|
||||
}
|
||||
|
||||
session_stack[i++] = workspacemenu->windowID();
|
||||
|
@ -1074,7 +1074,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ig
|
|||
if (! w) return;
|
||||
|
||||
if (wkspc_id >= workspaceNames.size())
|
||||
wkspc_id = current_workspace->getWorkspaceID();
|
||||
wkspc_id = current_workspace->workspaceID();
|
||||
|
||||
if (w->getWorkspaceNumber() == wkspc_id)
|
||||
return;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Screen.hh,v 1.28 2002/04/09 12:13:44 fluxgen Exp $
|
||||
// $Id: Screen.hh,v 1.29 2002/04/09 23:20:40 fluxgen Exp $
|
||||
|
||||
#ifndef SCREEN_HH
|
||||
#define SCREEN_HH
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); }
|
||||
inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); }
|
||||
inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; }
|
||||
inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->getWorkspaceID(); }
|
||||
inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); }
|
||||
|
||||
typedef std::vector<FluxboxWindow *> Icons;
|
||||
inline const unsigned int getCount(void) const { return workspacesList.size(); }
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Tab.cc,v 1.22 2002/04/03 23:01:04 fluxgen Exp $
|
||||
// $Id: Tab.cc,v 1.23 2002/04/09 23:15:36 fluxgen Exp $
|
||||
|
||||
#include "Tab.hh"
|
||||
|
||||
|
@ -286,7 +286,7 @@ void Tab::stick() {
|
|||
win->stuck = false;
|
||||
if (!win->isIconic()) {
|
||||
BScreen *screen = win->getScreen();
|
||||
screen->reassociateWindow(win, screen->getCurrentWorkspace()->getWorkspaceID(), true);
|
||||
screen->reassociateWindow(win, screen->getCurrentWorkspace()->workspaceID(), true);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Window.cc,v 1.41 2002/04/08 22:32:07 fluxgen Exp $
|
||||
// $Id: Window.cc,v 1.42 2002/04/09 23:17:11 fluxgen Exp $
|
||||
|
||||
#include "Window.hh"
|
||||
|
||||
|
@ -1952,8 +1952,8 @@ void FluxboxWindow::iconify(void) {
|
|||
|
||||
void FluxboxWindow::deiconify(bool reassoc, bool raise) {
|
||||
if (iconic || reassoc) {
|
||||
screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), false);
|
||||
} else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID())
|
||||
screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), false);
|
||||
} else if (workspace_number != screen->getCurrentWorkspace()->workspaceID())
|
||||
return;
|
||||
|
||||
setState(NormalState);
|
||||
|
@ -2376,7 +2376,7 @@ void FluxboxWindow::stick(void) {
|
|||
stuck = false;
|
||||
|
||||
if (! iconic)
|
||||
screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), true);
|
||||
screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), true);
|
||||
|
||||
|
||||
} else {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Windowmenu.cc,v 1.11 2002/04/08 22:35:16 fluxgen Exp $
|
||||
// $Id: Windowmenu.cc,v 1.12 2002/04/09 23:19:02 fluxgen Exp $
|
||||
|
||||
//use GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -239,7 +239,7 @@ void Windowmenu::SendtoWorkspacemenu::update(void) {
|
|||
remove(0);
|
||||
}
|
||||
for (i = 0; i < windowmenu->screen->getCount(); ++i)
|
||||
insert(windowmenu->screen->getWorkspace(i)->getName());
|
||||
insert(windowmenu->screen->getWorkspace(i)->name().c_str());
|
||||
|
||||
Basemenu::update();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Workspacemenu.cc,v 1.6 2002/04/09 23:19:17 fluxgen Exp $
|
||||
|
||||
//use GNU extension
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
@ -63,7 +65,7 @@ void Workspacemenu::itemSelected(int button, unsigned int index) {
|
|||
screen->addWorkspace();
|
||||
else if (index == 1)
|
||||
screen->removeLastWorkspace();
|
||||
else if ((screen->getCurrentWorkspace()->getWorkspaceID() !=
|
||||
else if ((screen->getCurrentWorkspace()->workspaceID() !=
|
||||
(index - 2)) && ((index - 2) < screen->getCount()))
|
||||
screen->changeWorkspaceID(index - 2);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: fluxbox.cc,v 1.48 2002/04/09 12:09:03 cout Exp $
|
||||
// $Id: fluxbox.cc,v 1.49 2002/04/09 23:14:25 fluxgen Exp $
|
||||
|
||||
//Use some GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -611,8 +611,7 @@ void Fluxbox::process_event(XEvent *e) {
|
|||
if (iskdedockapp) {
|
||||
XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask);
|
||||
std::list<BScreen *>::iterator it = screenList.begin();
|
||||
std::list<BScreen *>::iterator it_end = screenList.end();
|
||||
for (; (*it) == screenList->last(); ++it) {
|
||||
for (; (*it) == screenList.back(); ++it) {
|
||||
(*it)->getSlit()->addClient(e->xmaprequest.window);
|
||||
}
|
||||
return;
|
||||
|
@ -1850,8 +1849,8 @@ void Fluxbox::save_rc(void) {
|
|||
string workspaces_string(rc_string);
|
||||
|
||||
for (unsigned int workspace=0; workspace < screen->getCount(); workspace++) {
|
||||
if (screen->getWorkspace(workspace)->getName()!=0)
|
||||
workspaces_string.append(screen->getWorkspace(workspace)->getName());
|
||||
if (screen->getWorkspace(workspace)->name().size()!=0)
|
||||
workspaces_string.append(screen->getWorkspace(workspace)->name());
|
||||
else
|
||||
workspaces_string.append("Null");
|
||||
workspaces_string.append(",");
|
||||
|
@ -2402,7 +2401,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) {
|
|||
old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber());
|
||||
|
||||
old_win->setFocusFlag(False);
|
||||
old_wkspc->getMenu()->setItemSelected(old_win->getWindowNumber(), False);
|
||||
old_wkspc->menu()->setItemSelected(old_win->getWindowNumber(), false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -2413,7 +2412,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) {
|
|||
wkspc = screen->getWorkspace(win->getWorkspaceNumber());
|
||||
focused_window = win;
|
||||
win->setFocusFlag(True);
|
||||
wkspc->getMenu()->setItemSelected(win->getWindowNumber(), True);
|
||||
wkspc->menu()->setItemSelected(win->getWindowNumber(), true);
|
||||
|
||||
} else
|
||||
focused_window = (FluxboxWindow *) 0;
|
||||
|
|
Loading…
Reference in a new issue