aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authormathias <mathias>2005-07-25 23:17:41 (GMT)
committermathias <mathias>2005-07-25 23:17:41 (GMT)
commit7b21abc421380f10fa76823702eb99a8cf13297b (patch)
treee17b9d47070ad5ebbff2161ff0bd37cbfae420b9 /src/Window.cc
parent460dffdcc1f2de5463225feedd7d02f6f27958c2 (diff)
downloadfluxbox-7b21abc421380f10fa76823702eb99a8cf13297b.zip
fluxbox-7b21abc421380f10fa76823702eb99a8cf13297b.tar.bz2
Fix for #1240248, Segfaults for :MoveTabLeft/Right
wrong code in Container.cc
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 88690ce..db430f9 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -864,14 +864,12 @@ void FluxboxWindow::moveClientLeft() {
864 if (m_clientlist.size() == 1 || 864 if (m_clientlist.size() == 1 ||
865 *m_clientlist.begin() == &winClient()) 865 *m_clientlist.begin() == &winClient())
866 return; 866 return;
867 // move label button to the left 867
868 frame().moveLabelButtonLeft(*m_labelbuttons[&winClient()]);
869 // move client in clientlist to the left 868 // move client in clientlist to the left
870 ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), &winClient()); 869 ClientList::iterator oldpos = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
871 ClientList::iterator new_pos = it; 870 ClientList::iterator newpos = oldpos; newpos--;
872 new_pos--; 871 std::swap(*newpos, *oldpos);
873 m_clientlist.erase(it); 872 frame().moveLabelButtonLeft(*m_labelbuttons[&winClient()]);
874 m_clientlist.insert(new_pos, &winClient());
875 873
876 updateClientLeftWindow(); 874 updateClientLeftWindow();
877 875
@@ -879,15 +877,13 @@ void FluxboxWindow::moveClientLeft() {
879 877
880void FluxboxWindow::moveClientRight() { 878void FluxboxWindow::moveClientRight() {
881 if (m_clientlist.size() == 1 || 879 if (m_clientlist.size() == 1 ||
882 *m_clientlist.rbegin() == &winClient()) 880 *m_clientlist.rbegin() == &winClient())
883 return; 881 return;
884 // move label button to the right 882
883 ClientList::iterator oldpos = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
884 ClientList::iterator newpos = oldpos; newpos++;
885 std::swap(*newpos, *oldpos);
885 frame().moveLabelButtonRight(*m_labelbuttons[&winClient()]); 886 frame().moveLabelButtonRight(*m_labelbuttons[&winClient()]);
886 // move client in clientlist to the right
887 ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), &winClient());
888 ClientList::iterator new_pos = m_clientlist.erase(it);
889 new_pos++;
890 m_clientlist.insert(new_pos, &winClient());
891 887
892 updateClientLeftWindow(); 888 updateClientLeftWindow();
893} 889}