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