aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-08-30 14:03:31 (GMT)
committerfluxgen <fluxgen>2002-08-30 14:03:31 (GMT)
commitd86785056d5f8d69cf1b0a6a0142fa7b5a3b0aba (patch)
tree349fe5fde262334e72290a9ed54b63d6cee826e7 /src/Screen.cc
parent2b168a584f05af026a9b6fdd21fb17cfb57a9e2f (diff)
downloadfluxbox-d86785056d5f8d69cf1b0a6a0142fa7b5a3b0aba.zip
fluxbox-d86785056d5f8d69cf1b0a6a0142fa7b5a3b0aba.tar.bz2
new function reassociateGroup and check moving window
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 39b15b8..60c8a63 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.64 2002/08/24 18:12:54 fluxgen Exp $ 25// $Id: Screen.cc,v 1.65 2002/08/30 14:03:31 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -794,16 +794,20 @@ void BScreen::changeWorkspaceID(unsigned int id) {
794 794
795 if (id != current_workspace->workspaceID()) { 795 if (id != current_workspace->workspaceID()) {
796 XSync(fluxbox->getXDisplay(), true); 796 XSync(fluxbox->getXDisplay(), true);
797 797 FluxboxWindow *focused = fluxbox->getFocusedWindow();
798
799 if (focused && focused->isMoving()) {
800 reassociateGroup(focused, id, true);
801 focused->pauseMoving();
802 }
803
798 current_workspace->hideAll(); 804 current_workspace->hideAll();
799 805
800 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false); 806 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false);
801 807
802 if (fluxbox->getFocusedWindow() && 808 if (focused && focused->getScreen() == this &&
803 fluxbox->getFocusedWindow()->getScreen() == this && 809 (! focused->isStuck()) && (!focused->isMoving())) {
804 (! fluxbox->getFocusedWindow()->isStuck())) { 810 current_workspace->setLastFocusedWindow(focused);
805
806 current_workspace->setLastFocusedWindow(fluxbox->getFocusedWindow());
807 fluxbox->setFocusedWindow((FluxboxWindow *) 0); 811 fluxbox->setFocusedWindow((FluxboxWindow *) 0);
808 812
809 } 813 }
@@ -815,9 +819,14 @@ void BScreen::changeWorkspaceID(unsigned int id) {
815 819
816 current_workspace->showAll(); 820 current_workspace->showAll();
817 821
818 if (*resource.focus_last && current_workspace->getLastFocusedWindow()) 822 if (*resource.focus_last && current_workspace->getLastFocusedWindow() &&
823 !(focused && focused->isMoving())) {
819 current_workspace->getLastFocusedWindow()->setInputFocus(); 824 current_workspace->getLastFocusedWindow()->setInputFocus();
820 825 }
826
827 if (focused && focused->isMoving()) {
828 focused->resumeMoving();
829 }
821 } 830 }
822 831
823 updateNetizenCurrentWorkspace(); 832 updateNetizenCurrentWorkspace();
@@ -1091,6 +1100,18 @@ string BScreen::getNameOfWorkspace(unsigned int workspace) const {
1091 1100
1092} 1101}
1093 1102
1103void BScreen::reassociateGroup(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) {
1104 if (w->hasTab() && (w->getTab()->next() || w->getTab()->prev())) {
1105 Tab *tab_it = w->getTab()->first();
1106 for (; tab_it; tab_it = tab_it->next()) {
1107 reassociateWindow(tab_it->getWindow(), wkspc_id, ignore_sticky);
1108 }
1109 } else {
1110 // no tab, juts move this one
1111 reassociateWindow(w, wkspc_id, ignore_sticky);
1112 }
1113}
1114
1094 1115
1095void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) { 1116void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) {
1096 if (! w) return; 1117 if (! w) return;