diff options
author | fluxgen <fluxgen> | 2002-02-26 22:25:53 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-02-26 22:25:53 (GMT) |
commit | 8d911dcbddc22bea0cf453c333a9b0d7b5f3e783 (patch) | |
tree | 349642173ab9cff1456d4adbd7c43ed8b5a7e26d | |
parent | 33a42a6f5f32b90624c008fd24cd864335ba570a (diff) | |
download | fluxbox-8d911dcbddc22bea0cf453c333a9b0d7b5f3e783.zip fluxbox-8d911dcbddc22bea0cf453c333a9b0d7b5f3e783.tar.bz2 |
added sendToWorkspace(int id, bool changeWS)
-rw-r--r-- | src/Screen.cc | 49 | ||||
-rw-r--r-- | src/Screen.hh | 4 |
2 files changed, 44 insertions, 9 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index f942837..d5d8ebe 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.29 2002/02/21 12:03:40 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.30 2002/02/26 22:25:20 fluxgen Exp $ |
26 | 26 | ||
27 | // stupid macros needed to access some functions in version 2 of the GNU C | 27 | // stupid macros needed to access some functions in version 2 of the GNU C |
28 | // library | 28 | // library |
@@ -815,6 +815,40 @@ void BScreen::changeWorkspaceID(int id) { | |||
815 | updateNetizenCurrentWorkspace(); | 815 | updateNetizenCurrentWorkspace(); |
816 | } | 816 | } |
817 | 817 | ||
818 | void BScreen::sendToWorkspace(int id) { | ||
819 | BScreen::sendToWorkspace(id, true); | ||
820 | } | ||
821 | |||
822 | void BScreen::sendToWorkspace(int id, bool changeWS) { | ||
823 | FluxboxWindow *win; | ||
824 | if (! current_workspace || id >= workspacesList.size() || id < 0) | ||
825 | return; | ||
826 | |||
827 | if (id != current_workspace->getWorkspaceID()) { | ||
828 | XSync(fluxbox->getXDisplay(), True); | ||
829 | |||
830 | win = fluxbox->getFocusedWindow(); | ||
831 | |||
832 | if (win && win->getScreen() == this && | ||
833 | (! win->isStuck())) { | ||
834 | |||
835 | if ( win->getTab() ) { | ||
836 | Tab *tab = win->getTab(); | ||
837 | tab->disconnect(); | ||
838 | tab->setPosition(); | ||
839 | } | ||
840 | |||
841 | win->withdraw(); | ||
842 | BScreen::reassociateWindow(win, id, True); | ||
843 | if (changeWS) { | ||
844 | BScreen::changeWorkspaceID(id); | ||
845 | win->setInputFocus(); | ||
846 | } | ||
847 | } | ||
848 | |||
849 | } | ||
850 | } | ||
851 | |||
818 | 852 | ||
819 | void BScreen::addNetizen(Netizen *n) { | 853 | void BScreen::addNetizen(Netizen *n) { |
820 | netizenList.push_back(n); | 854 | netizenList.push_back(n); |
@@ -967,9 +1001,9 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) { | |||
967 | 1001 | ||
968 | 1002 | ||
969 | void BScreen::raiseWindows(Window *workspace_stack, int num) { | 1003 | void BScreen::raiseWindows(Window *workspace_stack, int num) { |
970 | Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)]; | ||
971 | int i = 0; | ||
972 | 1004 | ||
1005 | Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)]; | ||
1006 | int i = 0; | ||
973 | XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); | 1007 | XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); |
974 | session_stack[i++] = iconmenu->getWindowID(); | 1008 | session_stack[i++] = iconmenu->getWindowID(); |
975 | 1009 | ||
@@ -986,11 +1020,11 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) { | |||
986 | session_stack[i++] = configmenu->getTabmenu()->getWindowID(); | 1020 | session_stack[i++] = configmenu->getTabmenu()->getWindowID(); |
987 | session_stack[i++] = configmenu->getWindowID(); | 1021 | session_stack[i++] = configmenu->getWindowID(); |
988 | 1022 | ||
989 | #ifdef SLIT | 1023 | #ifdef SLIT |
990 | session_stack[i++] = slit->getMenu()->getDirectionmenu()->getWindowID(); | 1024 | session_stack[i++] = slit->getMenu()->getDirectionmenu()->getWindowID(); |
991 | session_stack[i++] = slit->getMenu()->getPlacementmenu()->getWindowID(); | 1025 | session_stack[i++] = slit->getMenu()->getPlacementmenu()->getWindowID(); |
992 | session_stack[i++] = slit->getMenu()->getWindowID(); | 1026 | session_stack[i++] = slit->getMenu()->getWindowID(); |
993 | #endif // SLIT | 1027 | #endif // SLIT |
994 | 1028 | ||
995 | session_stack[i++] = | 1029 | session_stack[i++] = |
996 | toolbar->getMenu()->getPlacementmenu()->getWindowID(); | 1030 | toolbar->getMenu()->getPlacementmenu()->getWindowID(); |
@@ -1006,10 +1040,10 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) { | |||
1006 | if (toolbar->isOnTop()) | 1040 | if (toolbar->isOnTop()) |
1007 | session_stack[i++] = toolbar->getWindowID(); | 1041 | session_stack[i++] = toolbar->getWindowID(); |
1008 | 1042 | ||
1009 | #ifdef SLIT | 1043 | #ifdef SLIT |
1010 | if (slit->isOnTop()) | 1044 | if (slit->isOnTop()) |
1011 | session_stack[i++] = slit->getWindowID(); | 1045 | session_stack[i++] = slit->getWindowID(); |
1012 | #endif // SLIT | 1046 | #endif // SLIT |
1013 | 1047 | ||
1014 | int k=num; | 1048 | int k=num; |
1015 | while (k--) | 1049 | while (k--) |
@@ -1019,7 +1053,6 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) { | |||
1019 | 1053 | ||
1020 | } | 1054 | } |
1021 | 1055 | ||
1022 | |||
1023 | #ifdef HAVE_STRFTIME | 1056 | #ifdef HAVE_STRFTIME |
1024 | void BScreen::saveStrftimeFormat(char *format) { | 1057 | void BScreen::saveStrftimeFormat(char *format) { |
1025 | if (resource.strftime_format) | 1058 | if (resource.strftime_format) |
diff --git a/src/Screen.hh b/src/Screen.hh index 6df6ca0..d7634a5 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -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.hh,v 1.20 2002/02/20 23:04:35 fluxgen Exp $ | 25 | // $Id: Screen.hh,v 1.21 2002/02/26 22:25:53 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -199,6 +199,8 @@ public: | |||
199 | void removeIcon(FluxboxWindow *); | 199 | void removeIcon(FluxboxWindow *); |
200 | void getNameOfWorkspace(int, char **); | 200 | void getNameOfWorkspace(int, char **); |
201 | void changeWorkspaceID(int); | 201 | void changeWorkspaceID(int); |
202 | void sendToWorkspace(int); | ||
203 | void sendToWorkspace(int, bool); | ||
202 | void raiseWindows(Window *, int); | 204 | void raiseWindows(Window *, int); |
203 | void reassociateWindow(FluxboxWindow *, int, Bool); | 205 | void reassociateWindow(FluxboxWindow *, int, Bool); |
204 | void prevFocus(void); | 206 | void prevFocus(void); |