aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/XLayer.cc42
1 files changed, 14 insertions, 28 deletions
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc
index 0341563..8e1dfc1 100644
--- a/src/FbTk/XLayer.cc
+++ b/src/FbTk/XLayer.cc
@@ -90,38 +90,24 @@ void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) {
90 if (!m_manager.isUpdatable()) 90 if (!m_manager.isUpdatable())
91 return; 91 return;
92 92
93 Window *winlist;
94 size_t winnum, size, num = item->numWindows();
95
96 // if there are no windows provided for above us, 93 // if there are no windows provided for above us,
97 // then we must have to go right to the top of the stack 94 // then we must restack the entire layer
95 // we can't do XRaiseWindow because a restack then causes OverrideRedirect
96 // windows to get pushed to the bottom
98 if (!above) { // must need to go right to top 97 if (!above) { // must need to go right to top
99 if (item->getWindows().front()->window()) 98 restack();
100 XRaiseWindow(FbTk::App::instance()->display(), item->getWindows().front()->window()); 99 return;
101
102 // if this XLayerItem has more than one window,
103 // then we'll stack the rest in under the front one too
104 // our size needs to be the number of windows in the group, since there isn't one above.
105 if (num > 1) {
106 winnum = 0;
107 // stack relative to top one (just raised)
108 size = num;
109 winlist = new Window[size];
110 } else {
111 // we've raised the window, nothing else to do
112 return;
113 }
114 } else {
115 // We do have a window to stack below
116
117 // so we put it on top, and fill the rest of the array with the ones to go below it.
118 winnum = 1;
119 size = num+1;
120 winlist = new Window[size];
121 // assume that above's window exists
122 winlist[0] = above->getWindows().back()->window();
123 } 100 }
124 101
102 Window *winlist;
103 size_t winnum = 1, size = item->numWindows()+1;
104
105 // We do have a window to stack below
106 // so we put it on top, and fill the rest of the array with the ones to go below it.
107 winlist = new Window[size];
108 // assume that above's window exists
109 winlist[0] = above->getWindows().back()->window();
110
125 // fill the rest of the array 111 // fill the rest of the array
126 XLayerItem::Windows::iterator it = item->getWindows().begin(); 112 XLayerItem::Windows::iterator it = item->getWindows().begin();
127 XLayerItem::Windows::iterator it_end = item->getWindows().end(); 113 XLayerItem::Windows::iterator it_end = item->getWindows().end();