aboutsummaryrefslogtreecommitdiff
path: root/src/Tab.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-04-14 22:27:57 (GMT)
committerfluxgen <fluxgen>2002-04-14 22:27:57 (GMT)
commit875d63b6d955850b07825cc3228bc7d638f89bc5 (patch)
tree46dca65c521abf57b42810719acb99a5c131ed41 /src/Tab.cc
parent3e08be1c2abe6830f62432302b3836cb0d82fcce (diff)
downloadfluxbox-875d63b6d955850b07825cc3228bc7d638f89bc5.zip
fluxbox-875d63b6d955850b07825cc3228bc7d638f89bc5.tar.bz2
tabs default off
Diffstat (limited to 'src/Tab.cc')
-rw-r--r--src/Tab.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/Tab.cc b/src/Tab.cc
index 4ade4f7..9b991ab 100644
--- a/src/Tab.cc
+++ b/src/Tab.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Tab.cc,v 1.23 2002/04/09 23:15:36 fluxgen Exp $ 22// $Id: Tab.cc,v 1.24 2002/04/14 22:27:57 fluxgen Exp $
23 23
24#include "Tab.hh" 24#include "Tab.hh"
25 25
@@ -262,6 +262,8 @@ void Tab::deiconify() {
262void Tab::iconify() { 262void Tab::iconify() {
263 disconnect(); 263 disconnect();
264 withdraw(); 264 withdraw();
265 if(!Fluxbox::instance()->useTabs() && !m_next && !m_prev)//if we don't want to use tabs that much
266 m_win->setTab(false);//let's get rid of this loner tab
265} 267}
266 268
267//------------ withdraw -------------- 269//------------ withdraw --------------
@@ -671,9 +673,11 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
671 if (XTranslateCoordinates(m_display, m_win->getScreen()->getRootWindow(), 673 if (XTranslateCoordinates(m_display, m_win->getScreen()->getRootWindow(),
672 m_win->getScreen()->getRootWindow(), 674 m_win->getScreen()->getRootWindow(),
673 be->x_root, be->y_root, &dest_x, &dest_y, &child)) { 675 be->x_root, be->y_root, &dest_x, &dest_y, &child)) {
674 676
675 Tab *tab = Fluxbox::instance()->searchTab(child); 677 Tab *tab = Fluxbox::instance()->searchTab(child);
676 FluxboxWindow *win = Fluxbox::instance()->searchWindow(child); 678 FluxboxWindow *win = Fluxbox::instance()->searchWindow(child);
679 if(win!=0 && m_win->getScreen()->isSloppyWindowGrouping())
680 win->setTab(true);
677 //search tablist for a tabwindow 681 //search tablist for a tabwindow
678 if ( (tab!=0) || (m_win->getScreen()->isSloppyWindowGrouping() && 682 if ( (tab!=0) || (m_win->getScreen()->isSloppyWindowGrouping() &&
679 (win!=0) && (tab = win->getTab())!=0)) { 683 (win!=0) && (tab = win->getTab())!=0)) {
@@ -689,7 +693,7 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
689 // attach this tabwindow chain to the tabwindow chain we found. 693 // attach this tabwindow chain to the tabwindow chain we found.
690 tab->insert(this); 694 tab->insert(this);
691 695
692 } else { 696 } else { //Dropped nowhere
693 disconnect(); 697 disconnect();
694 698
695 // convenience 699 // convenience
@@ -736,6 +740,8 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
736 //TODO: this causes an calculate increase event, even if we 740 //TODO: this causes an calculate increase event, even if we
737 // only are moving a window 741 // only are moving a window
738 m_win->configure(dest_x, dest_y, m_win->getWidth(), m_win->getHeight()); 742 m_win->configure(dest_x, dest_y, m_win->getWidth(), m_win->getHeight());
743 if(!Fluxbox::instance()->useTabs())
744 m_win->setTab(0);//Remove tab from window, as it is now alone...
739 } 745 }
740 } 746 }
741 } else { 747 } else {
@@ -971,13 +977,21 @@ void Tab::insert(Tab *tab) {
971//-------------------------------------- 977//--------------------------------------
972void Tab::disconnect() { 978void Tab::disconnect() {
973 Tab *tmp = 0; 979 Tab *tmp = 0;
980
981 Fluxbox *fluxbox = Fluxbox::instance();
974 if (m_prev) { //if this have a chain to "the left" (previous tab) then set it's next to this next 982 if (m_prev) { //if this have a chain to "the left" (previous tab) then set it's next to this next
975 m_prev->m_next = m_next; 983 m_prev->m_next = m_next;
976 tmp = m_prev; 984 if(!m_next && !fluxbox->useTabs())//Only two tabs in list, remove tab from remaining window
985 m_prev->m_win->setTab(false);
986 else
987 tmp = m_prev;
977 } 988 }
978 if (m_next) { //if this have a chain to "the right" (next tab) then set it's prev to this prev 989 if (m_next) { //if this have a chain to "the right" (next tab) then set it's prev to this prev
979 m_next->m_prev = m_prev; 990 m_next->m_prev = m_prev;
980 tmp = m_next; 991 if(!m_prev && !fluxbox->useTabs())//Only two tabs in list, remove tab from remaining window
992 m_next->m_win->setTab(false);
993 else
994 tmp = m_next;
981 } 995 }
982 996
983 //mark as no chain, previous and next. 997 //mark as no chain, previous and next.