aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonb <simonb>2006-03-23 02:06:51 (GMT)
committersimonb <simonb>2006-03-23 02:06:51 (GMT)
commitffae659b3ecc080fdd98c8825d8e643cc66ccf27 (patch)
treece31a25b792013807714e12afe7ca4f3f112838e
parent15f53b5556403a8301fc7be4512b6f8ce52ffa5d (diff)
downloadfluxbox_paul-ffae659b3ecc080fdd98c8825d8e643cc66ccf27.zip
fluxbox_paul-ffae659b3ecc080fdd98c8825d8e643cc66ccf27.tar.bz2
external tab fixes, plus aligning items properly
-rw-r--r--ChangeLog4
-rw-r--r--src/FbTk/XLayer.cc35
-rw-r--r--src/FbTk/XLayerItem.cc2
-rw-r--r--src/FbTk/XLayerItem.hh1
-rw-r--r--src/FbWinFrame.cc10
5 files changed, 31 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fdce70..7e6e99d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.16: 2Changes for 0.9.16:
3*06/03/23:
4 * Fix some tab stacking alignment and rendering on tab resize (Simon)
5 (and very minor tidying)
6 FbWinFrame.cc FbTk/XLayer.cc FbTk/XLayerItem.hh/cc
3*06/03/22: 7*06/03/22:
4 * More external tabs work (Simon) 8 * More external tabs work (Simon)
5 - Can now be placed TopLeft/TopRight/BottomLeft/BottomRight 9 - Can now be placed TopLeft/TopRight/BottomLeft/BottomRight
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc
index 63881d3..8d1d80a 100644
--- a/src/FbTk/XLayer.cc
+++ b/src/FbTk/XLayer.cc
@@ -131,24 +131,33 @@ void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) {
131 131
132} 132}
133 133
134// We can't just use Restack here, because it won't do anything if they're
135// already in the same relative order excluding other windows
134void XLayer::alignItem(XLayerItem &item) { 136void XLayer::alignItem(XLayerItem &item) {
137 if (itemList().front() == &item) {
138 stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum));
139 return;
140 }
141
135 // Note: some other things effectively assume that the window list is 142 // Note: some other things effectively assume that the window list is
136 // sorted from highest to lowest 143 // sorted from highest to lowest
137 size_t winnum = 0, 144 // get our item
138 num = item.numWindows(); 145 iterator myit = std::find(itemList().begin(), itemList().end(), &item);
139 Window *winlist = new Window[num]; 146 iterator it = myit;
140 147
141 // fill the rest of the array 148 // go to the one above it in our layer (top is front, so we decrement)
142 XLayerItem::Windows::iterator it = item.getWindows().begin(); 149 --it;
143 XLayerItem::Windows::iterator it_end = item.getWindows().end(); 150
144 for (; it != it_end; ++it) { 151 // keep going until we find one that is currently visible to the user
145 if ((*it)->window()) { 152 while (it != itemList().begin() && !(*it)->visible())
146 winlist[winnum++] = (*it)->window(); 153 --it;
147 } 154
148 } 155 if (it == itemList().begin() && !(*it)->visible())
156 // reached front item, but it wasn't visible, therefore it was already raised
157 stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum));
158 else
159 stackBelowItem(&item, *it);
149 160
150 XRestackWindows(FbTk::App::instance()->display(), winlist, winnum);
151 delete [] winlist;
152} 161}
153 162
154XLayer::iterator XLayer::insert(XLayerItem &item, unsigned int pos) { 163XLayer::iterator XLayer::insert(XLayerItem &item, unsigned int pos) {
diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc
index 95befe7..ff554ad 100644
--- a/src/FbTk/XLayerItem.cc
+++ b/src/FbTk/XLayerItem.cc
@@ -28,7 +28,7 @@
28using namespace FbTk; 28using namespace FbTk;
29 29
30XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) : 30XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) :
31 m_layer(&layer), m_layeriterator(0) { 31 m_layer(&layer) {
32 m_windows.push_front(&win); 32 m_windows.push_front(&win);
33 m_layer->insert(*this); 33 m_layer->insert(*this);
34} 34}
diff --git a/src/FbTk/XLayerItem.hh b/src/FbTk/XLayerItem.hh
index 3cca8a9..3d778bb 100644
--- a/src/FbTk/XLayerItem.hh
+++ b/src/FbTk/XLayerItem.hh
@@ -79,7 +79,6 @@ public:
79 79
80private: 80private:
81 XLayer *m_layer; 81 XLayer *m_layer;
82 XLayer::iterator m_layeriterator;
83 Windows m_windows; 82 Windows m_windows;
84}; 83};
85 84
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 736e049..0e61492 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -207,10 +207,12 @@ bool FbWinFrame::setTabMode(TabMode tabmode) {
207 applyTabContainer(); 207 applyTabContainer();
208 m_tab_container.clear(); 208 m_tab_container.clear();
209 209
210 m_tab_container.raise();
211 m_tab_container.show();
212
210 if (!m_use_tabs) 213 if (!m_use_tabs)
211 m_tab_container.show();
212 else
213 ret = false; 214 ret = false;
215
214 m_label.hide(); 216 m_label.hide();
215// reconfigure(); 217// reconfigure();
216 } 218 }
@@ -1296,10 +1298,6 @@ void FbWinFrame::init() {
1296 m_label.setEventMask(ExposureMask | ButtonPressMask | 1298 m_label.setEventMask(ExposureMask | ButtonPressMask |
1297 ButtonReleaseMask | ButtonMotionMask | 1299 ButtonReleaseMask | ButtonMotionMask |
1298 EnterWindowMask); 1300 EnterWindowMask);
1299 m_label.show();
1300
1301 m_tab_container.show();
1302 m_tab_container.raise();
1303 1301
1304 showHandle(); 1302 showHandle();
1305 showTitlebar(); 1303 showTitlebar();