diff options
author | rathnor <rathnor> | 2003-02-18 15:08:12 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-02-18 15:08:12 (GMT) |
commit | aa602770fbbd4e84154028d3181d275b81ea914d (patch) | |
tree | a626f85fa25292ba6293bfac0f0c44117a04830c /src/FbTk/XLayer.cc | |
parent | 9de08b90e82681d8b49b4b17251d83fd05a413cc (diff) | |
download | fluxbox_pavel-aa602770fbbd4e84154028d3181d275b81ea914d.zip fluxbox_pavel-aa602770fbbd4e84154028d3181d275b81ea914d.tar.bz2 |
change XLayerItem to hold FbWindows instead of X Window IDs (Window)
Diffstat (limited to 'src/FbTk/XLayer.cc')
-rw-r--r-- | src/FbTk/XLayer.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index b5e9756..43bd76c 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: XLayer.cc,v 1.5 2003/02/09 14:11:14 rathnor Exp $ | 23 | // $Id: XLayer.cc,v 1.6 2003/02/18 15:08:12 rathnor Exp $ |
24 | 24 | ||
25 | #include "XLayer.hh" | 25 | #include "XLayer.hh" |
26 | #include "XLayerItem.hh" | 26 | #include "XLayerItem.hh" |
@@ -53,12 +53,13 @@ void XLayer::restack() { | |||
53 | for (size_t i=0; it != it_end; ++it, i++) { | 53 | for (size_t i=0; it != it_end; ++it, i++) { |
54 | XLayerItem::Windows::const_iterator wit = (*it)->getWindows().begin(); | 54 | XLayerItem::Windows::const_iterator wit = (*it)->getWindows().begin(); |
55 | XLayerItem::Windows::const_iterator wit_end = (*it)->getWindows().end(); | 55 | XLayerItem::Windows::const_iterator wit_end = (*it)->getWindows().end(); |
56 | for (; wit != wit_end; ++wit, j++) { | 56 | for (; wit != wit_end; ++wit) { |
57 | winlist[j] = (*wit); | 57 | if ((*wit)->window()) |
58 | winlist[j++] = (*wit)->window(); | ||
58 | } | 59 | } |
59 | } | 60 | } |
60 | 61 | ||
61 | XRestackWindows(FbTk::App::instance()->display(), winlist, num_windows); | 62 | XRestackWindows(FbTk::App::instance()->display(), winlist, j); |
62 | 63 | ||
63 | delete [] winlist; | 64 | delete [] winlist; |
64 | 65 | ||
@@ -84,7 +85,8 @@ void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) { | |||
84 | // if there are no windows provided for above us, | 85 | // if there are no windows provided for above us, |
85 | // then we must have to go right to the top of the stack | 86 | // then we must have to go right to the top of the stack |
86 | if (!above) { // must need to go right to top | 87 | if (!above) { // must need to go right to top |
87 | XRaiseWindow(FbTk::App::instance()->display(), item->getWindows().front()); | 88 | if (item->getWindows().front()->window()) |
89 | XRaiseWindow(FbTk::App::instance()->display(), item->getWindows().front()->window()); | ||
88 | 90 | ||
89 | // if this XLayerItem has more than one window, | 91 | // if this XLayerItem has more than one window, |
90 | // then we'll stack the rest in under the front one too | 92 | // then we'll stack the rest in under the front one too |
@@ -105,18 +107,20 @@ void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) { | |||
105 | winnum = 1; | 107 | winnum = 1; |
106 | size = num+1; | 108 | size = num+1; |
107 | winlist = new Window[size]; | 109 | winlist = new Window[size]; |
108 | winlist[0] = above->getWindows().back(); | 110 | // assume that above's window exists |
111 | winlist[0] = above->getWindows().back()->window(); | ||
109 | } | 112 | } |
110 | 113 | ||
111 | // fill the rest of the array | 114 | // fill the rest of the array |
112 | XLayerItem::Windows::iterator it = item->getWindows().begin(); | 115 | XLayerItem::Windows::iterator it = item->getWindows().begin(); |
113 | XLayerItem::Windows::iterator it_end = item->getWindows().end(); | 116 | XLayerItem::Windows::iterator it_end = item->getWindows().end(); |
114 | for (; it != it_end; ++it, winnum++) { | 117 | for (; it != it_end; ++it) { |
115 | winlist[winnum] = (*it); | 118 | if ((*it)->window()) |
119 | winlist[winnum++] = (*it)->window(); | ||
116 | } | 120 | } |
117 | 121 | ||
118 | // stack the windows | 122 | // stack the windows |
119 | XRestackWindows(FbTk::App::instance()->display(), winlist, size); | 123 | XRestackWindows(FbTk::App::instance()->display(), winlist, winnum); |
120 | 124 | ||
121 | delete [] winlist; | 125 | delete [] winlist; |
122 | 126 | ||