all repos — fluxbox @ d86785056d5f8d69cf1b0a6a0142fa7b5a3b0aba

custom fork of the fluxbox windowmanager

new function reassociateGroup and check moving window
fluxgen fluxgen
commit

d86785056d5f8d69cf1b0a6a0142fa7b5a3b0aba

parent

2b168a584f05af026a9b6fdd21fb17cfb57a9e2f

2 files changed, 36 insertions(+), 11 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.64 2002/08/24 18:12:54 fluxgen Exp $ +// $Id: Screen.cc,v 1.65 2002/08/30 14:03:31 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -794,16 +794,20 @@ return;

if (id != current_workspace->workspaceID()) { XSync(fluxbox->getXDisplay(), true); - + FluxboxWindow *focused = fluxbox->getFocusedWindow(); + + if (focused && focused->isMoving()) { + reassociateGroup(focused, id, true); + focused->pauseMoving(); + } + current_workspace->hideAll(); workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false); - if (fluxbox->getFocusedWindow() && - fluxbox->getFocusedWindow()->getScreen() == this && - (! fluxbox->getFocusedWindow()->isStuck())) { - - current_workspace->setLastFocusedWindow(fluxbox->getFocusedWindow()); + if (focused && focused->getScreen() == this && + (! focused->isStuck()) && (!focused->isMoving())) { + current_workspace->setLastFocusedWindow(focused); fluxbox->setFocusedWindow((FluxboxWindow *) 0); }

@@ -815,9 +819,14 @@ toolbar->redrawWorkspaceLabel(true);

current_workspace->showAll(); - if (*resource.focus_last && current_workspace->getLastFocusedWindow()) + if (*resource.focus_last && current_workspace->getLastFocusedWindow() && + !(focused && focused->isMoving())) { current_workspace->getLastFocusedWindow()->setInputFocus(); - + } + + if (focused && focused->isMoving()) { + focused->resumeMoving(); + } } updateNetizenCurrentWorkspace();

@@ -1089,6 +1098,18 @@ } else {

return ""; } +} + +void BScreen::reassociateGroup(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) { + if (w->hasTab() && (w->getTab()->next() || w->getTab()->prev())) { + Tab *tab_it = w->getTab()->first(); + for (; tab_it; tab_it = tab_it->next()) { + reassociateWindow(tab_it->getWindow(), wkspc_id, ignore_sticky); + } + } else { + // no tab, juts move this one + reassociateWindow(w, wkspc_id, ignore_sticky); + } }
M src/Screen.hhsrc/Screen.hh

@@ -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.hh,v 1.42 2002/08/11 22:11:42 fluxgen Exp $ +// $Id: Screen.hh,v 1.43 2002/08/30 14:03:31 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH

@@ -126,11 +126,14 @@ inline unsigned int getBorderWidth2x() const { return theme->getBorderWidth()*2; }

inline unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); } typedef std::vector<FluxboxWindow *> Icons; + + /// @return number of workspaces inline unsigned int getCount() const { return workspacesList.size(); } + /// @return number of icons inline unsigned int getIconCount() const { return iconList.size(); } inline const Icons &getIconList() const { return iconList; } inline Icons &getIconList() { return iconList; } - + /// @return the resource value of number of workspace inline int getNumberOfWorkspaces() const { return *resource.workspaces; } inline Toolbar::Placement getToolbarPlacement() const { return *resource.toolbar_placement; } #ifdef XINERAMA

@@ -219,6 +222,7 @@ std::string getNameOfWorkspace(unsigned int workspace) const;

void changeWorkspaceID(unsigned int); void sendToWorkspace(unsigned int workspace, FluxboxWindow *win=0, bool changeworkspace=true); void raiseWindows(Window *workspace_stack, int num); + void reassociateGroup(FluxboxWindow *window, unsigned int workspace_id, bool ignore_sticky); void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id, bool ignore_sticky); void prevFocus(int = 0); void nextFocus(int = 0);