added sendToWorkspace(int id, bool changeWS)

This commit is contained in:
fluxgen 2002-02-26 22:25:53 +00:00
parent 33a42a6f5f
commit 8d911dcbdd
2 changed files with 44 additions and 9 deletions

View file

@ -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.29 2002/02/21 12:03:40 fluxgen Exp $ // $Id: Screen.cc,v 1.30 2002/02/26 22:25:20 fluxgen Exp $
// stupid macros needed to access some functions in version 2 of the GNU C // stupid macros needed to access some functions in version 2 of the GNU C
// library // library
@ -815,6 +815,40 @@ void BScreen::changeWorkspaceID(int id) {
updateNetizenCurrentWorkspace(); updateNetizenCurrentWorkspace();
} }
void BScreen::sendToWorkspace(int id) {
BScreen::sendToWorkspace(id, true);
}
void BScreen::sendToWorkspace(int id, bool changeWS) {
FluxboxWindow *win;
if (! current_workspace || id >= workspacesList.size() || id < 0)
return;
if (id != current_workspace->getWorkspaceID()) {
XSync(fluxbox->getXDisplay(), True);
win = fluxbox->getFocusedWindow();
if (win && win->getScreen() == this &&
(! win->isStuck())) {
if ( win->getTab() ) {
Tab *tab = win->getTab();
tab->disconnect();
tab->setPosition();
}
win->withdraw();
BScreen::reassociateWindow(win, id, True);
if (changeWS) {
BScreen::changeWorkspaceID(id);
win->setInputFocus();
}
}
}
}
void BScreen::addNetizen(Netizen *n) { void BScreen::addNetizen(Netizen *n) {
netizenList.push_back(n); netizenList.push_back(n);
@ -967,9 +1001,9 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) {
void BScreen::raiseWindows(Window *workspace_stack, int num) { void BScreen::raiseWindows(Window *workspace_stack, int num) {
Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)]; Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)];
int i = 0; int i = 0;
XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID());
session_stack[i++] = iconmenu->getWindowID(); session_stack[i++] = iconmenu->getWindowID();
@ -1019,7 +1053,6 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) {
} }
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
void BScreen::saveStrftimeFormat(char *format) { void BScreen::saveStrftimeFormat(char *format) {
if (resource.strftime_format) if (resource.strftime_format)

View file

@ -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.20 2002/02/20 23:04:35 fluxgen Exp $ // $Id: Screen.hh,v 1.21 2002/02/26 22:25:53 fluxgen Exp $
#ifndef SCREEN_HH #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
@ -199,6 +199,8 @@ public:
void removeIcon(FluxboxWindow *); void removeIcon(FluxboxWindow *);
void getNameOfWorkspace(int, char **); void getNameOfWorkspace(int, char **);
void changeWorkspaceID(int); void changeWorkspaceID(int);
void sendToWorkspace(int);
void sendToWorkspace(int, bool);
void raiseWindows(Window *, int); void raiseWindows(Window *, int);
void reassociateWindow(FluxboxWindow *, int, Bool); void reassociateWindow(FluxboxWindow *, int, Bool);
void prevFocus(void); void prevFocus(void);