diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-01 08:38:56 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-01 08:38:56 (GMT) |
commit | 269459e1aa0a8c0ab9be67cf11bb836ecc191f31 (patch) | |
tree | 09fa57effb9f6c0b6f6456a11a6ce2b45d1c66f0 /src/FbTk/XLayer.cc | |
parent | b3da022ee22acd67f6ef6210e7412dbfc8fdfa70 (diff) | |
download | fluxbox-269459e1aa0a8c0ab9be67cf11bb836ecc191f31.zip fluxbox-269459e1aa0a8c0ab9be67cf11bb836ecc191f31.tar.bz2 |
don't flash original window in the middle of cycling focus
Diffstat (limited to 'src/FbTk/XLayer.cc')
-rw-r--r-- | src/FbTk/XLayer.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 0d878d3..2d92080 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc | |||
@@ -37,7 +37,7 @@ using std::endl; | |||
37 | #endif // DEBUG | 37 | #endif // DEBUG |
38 | 38 | ||
39 | XLayer::XLayer(MultLayers &manager, int layernum): | 39 | XLayer::XLayer(MultLayers &manager, int layernum): |
40 | m_manager(manager), m_layernum(layernum) { | 40 | m_manager(manager), m_layernum(layernum), m_needs_restack(false) { |
41 | } | 41 | } |
42 | 42 | ||
43 | XLayer::~XLayer() { | 43 | XLayer::~XLayer() { |
@@ -70,6 +70,7 @@ void XLayer::restack() { | |||
70 | 70 | ||
71 | delete [] winlist; | 71 | delete [] winlist; |
72 | 72 | ||
73 | m_needs_restack = false; | ||
73 | } | 74 | } |
74 | 75 | ||
75 | int XLayer::countWindows() { | 76 | int XLayer::countWindows() { |
@@ -177,8 +178,11 @@ void XLayer::remove(XLayerItem &item) { | |||
177 | void XLayer::raise(XLayerItem &item) { | 178 | void XLayer::raise(XLayerItem &item) { |
178 | // assume it is already in this layer | 179 | // assume it is already in this layer |
179 | 180 | ||
180 | if (&item == itemList().front()) | 181 | if (&item == itemList().front()) { |
182 | if (m_needs_restack) | ||
183 | restack(); | ||
181 | return; // nothing to do | 184 | return; // nothing to do |
185 | } | ||
182 | 186 | ||
183 | iterator it = find(itemList().begin(), itemList().end(), &item); | 187 | iterator it = find(itemList().begin(), itemList().end(), &item); |
184 | if (it != itemList().end()) | 188 | if (it != itemList().end()) |
@@ -198,7 +202,7 @@ void XLayer::raise(XLayerItem &item) { | |||
198 | void XLayer::tempRaise(XLayerItem &item) { | 202 | void XLayer::tempRaise(XLayerItem &item) { |
199 | // assume it is already in this layer | 203 | // assume it is already in this layer |
200 | 204 | ||
201 | if (&item == itemList().front()) | 205 | if (!m_needs_restack && &item == itemList().front()) |
202 | return; // nothing to do | 206 | return; // nothing to do |
203 | 207 | ||
204 | iterator it = find(itemList().begin(), itemList().end(), &item); | 208 | iterator it = find(itemList().begin(), itemList().end(), &item); |
@@ -212,14 +216,18 @@ void XLayer::tempRaise(XLayerItem &item) { | |||
212 | // don't add it back to the top | 216 | // don't add it back to the top |
213 | stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); | 217 | stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); |
214 | 218 | ||
219 | m_needs_restack = true; | ||
215 | } | 220 | } |
216 | 221 | ||
217 | void XLayer::lower(XLayerItem &item) { | 222 | void XLayer::lower(XLayerItem &item) { |
218 | // assume already in this layer | 223 | // assume already in this layer |
219 | 224 | ||
220 | // is it already the lowest? | 225 | // is it already the lowest? |
221 | if (&item == itemList().back()) | 226 | if (&item == itemList().back()) { |
227 | if (m_needs_restack) | ||
228 | restack(); | ||
222 | return; // nothing to do | 229 | return; // nothing to do |
230 | } | ||
223 | 231 | ||
224 | iterator it = find(itemList().begin(), itemList().end(), &item); | 232 | iterator it = find(itemList().begin(), itemList().end(), &item); |
225 | if (it != itemList().end()) | 233 | if (it != itemList().end()) |