aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-07-28 12:49:18 (GMT)
committerfluxgen <fluxgen>2003-07-28 12:49:18 (GMT)
commit985ee077e89bd14abf58f237178deb7d26d74bbd (patch)
tree999f0833f67406cddbd206a54dd9ac3fc3dfbbd6 /src/Window.cc
parentb9a62bbd5edd80cbe418b081d833e7f422d52bf1 (diff)
downloadfluxbox-985ee077e89bd14abf58f237178deb7d26d74bbd.zip
fluxbox-985ee077e89bd14abf58f237178deb7d26d74bbd.tar.bz2
added moveClientLeft and Right
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/Window.cc b/src/Window.cc
index ba5b346..ac2333b 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.211 2003/07/26 16:17:01 rathnor Exp $ 25// $Id: Window.cc,v 1.212 2003/07/28 12:49:18 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -854,6 +854,57 @@ void FluxboxWindow::prevClient() {
854 setInputFocus(); 854 setInputFocus();
855} 855}
856 856
857
858void FluxboxWindow::moveClientLeft() {
859 if (m_clientlist.size() == 1 ||
860 *m_clientlist.begin() == &winClient())
861 return;
862 // move label button to the left
863 frame().moveLabelButtonLeft(*m_labelbuttons[&winClient()]);
864 // move client in clientlist to the left
865 ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
866 ClientList::iterator new_pos = it;
867 new_pos--;
868 m_clientlist.erase(it);
869 m_clientlist.insert(new_pos, &winClient());
870
871 updateClientLeftWindow();
872
873}
874
875void FluxboxWindow::moveClientRight() {
876 if (m_clientlist.size() == 1)
877 return;
878 // move label button to the right
879 frame().moveLabelButtonRight(*m_labelbuttons[&winClient()]);
880 // move client in clientlist to the right
881 ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
882 ClientList::iterator new_pos = m_clientlist.erase(it);
883 new_pos++;
884 m_clientlist.insert(new_pos, &winClient());
885
886 updateClientLeftWindow();
887}
888
889/// Update LEFT window atom on all clients.
890void FluxboxWindow::updateClientLeftWindow() {
891 // It should just update the affected clients but that
892 // would require more complex code and we're assuming
893 // the user dont have alot of windows grouped so this
894 // wouldn't be too time consuming and it's easier to
895 // implement.
896 ClientList::iterator it = clientList().begin();
897 ClientList::iterator it_end = clientList().end();
898 // set no left window on first tab
899 (*it)->setGroupLeftWindow(0);
900 WinClient *last_client = *it;
901 ++it;
902 for (; it != it_end; ++it) {
903 (*it)->setGroupLeftWindow(last_client->window());
904 last_client = *it;
905 }
906}
907
857bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { 908bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
858 // make sure it's in our list 909 // make sure it's in our list
859 if (client.m_win != this) 910 if (client.m_win != this)