aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-10-01 08:38:56 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-10-01 08:38:56 (GMT)
commit269459e1aa0a8c0ab9be67cf11bb836ecc191f31 (patch)
tree09fa57effb9f6c0b6f6456a11a6ce2b45d1c66f0 /src/FbTk
parentb3da022ee22acd67f6ef6210e7412dbfc8fdfa70 (diff)
downloadfluxbox-269459e1aa0a8c0ab9be67cf11bb836ecc191f31.zip
fluxbox-269459e1aa0a8c0ab9be67cf11bb836ecc191f31.tar.bz2
don't flash original window in the middle of cycling focus
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Layer.hh3
-rw-r--r--src/FbTk/MultLayers.hh5
-rw-r--r--src/FbTk/XLayer.cc16
-rw-r--r--src/FbTk/XLayer.hh5
4 files changed, 19 insertions, 10 deletions
diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh
index 405285c..b9257c3 100644
--- a/src/FbTk/Layer.hh
+++ b/src/FbTk/Layer.hh
@@ -43,7 +43,6 @@ public:
43 virtual void raise(ItemType &item); 43 virtual void raise(ItemType &item);
44 /// move item to bottom 44 /// move item to bottom
45 virtual void lower(ItemType &item); 45 virtual void lower(ItemType &item);
46 virtual void restack();
47 /// @return layer item on specific position, on failure 0 46 /// @return layer item on specific position, on failure 0
48 ItemType *getItem(unsigned int position); 47 ItemType *getItem(unsigned int position);
49 /// @return number of elements in layer 48 /// @return number of elements in layer
@@ -52,6 +51,8 @@ public:
52 const ListType &itemList() const { return m_list; } 51 const ListType &itemList() const { return m_list; }
53 /// @return layer list 52 /// @return layer list
54 ListType &itemList() { return m_list; } 53 ListType &itemList() { return m_list; }
54protected:
55 virtual void restack();
55private: 56private:
56 ListType m_list; 57 ListType m_list;
57}; 58};
diff --git a/src/FbTk/MultLayers.hh b/src/FbTk/MultLayers.hh
index e502ed6..2e3915d 100644
--- a/src/FbTk/MultLayers.hh
+++ b/src/FbTk/MultLayers.hh
@@ -52,7 +52,6 @@ public:
52 52
53 void moveToLayer(XLayerItem &item, int layernum); 53 void moveToLayer(XLayerItem &item, int layernum);
54 int size(); 54 int size();
55 void restack();
56 55
57 XLayer *getLayer(size_t num); 56 XLayer *getLayer(size_t num);
58 const XLayer *getLayer(size_t num) const; 57 const XLayer *getLayer(size_t num) const;
@@ -62,10 +61,10 @@ public:
62 void unlock() { if (--m_lock == 0) restack(); } 61 void unlock() { if (--m_lock == 0) restack(); }
63 62
64private: 63private:
65 std::vector<XLayer *> m_layers; 64 void restack();
66 65
66 std::vector<XLayer *> m_layers;
67 int m_lock; 67 int m_lock;
68
69}; 68};
70 69
71}; 70};
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
39XLayer::XLayer(MultLayers &manager, int layernum): 39XLayer::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
43XLayer::~XLayer() { 43XLayer::~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
75int XLayer::countWindows() { 76int XLayer::countWindows() {
@@ -177,8 +178,11 @@ void XLayer::remove(XLayerItem &item) {
177void XLayer::raise(XLayerItem &item) { 178void 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) {
198void XLayer::tempRaise(XLayerItem &item) { 202void 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
217void XLayer::lower(XLayerItem &item) { 222void 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())
diff --git a/src/FbTk/XLayer.hh b/src/FbTk/XLayer.hh
index acc299c..bfd7010 100644
--- a/src/FbTk/XLayer.hh
+++ b/src/FbTk/XLayer.hh
@@ -44,7 +44,6 @@ public:
44 44
45 void setLayerNum(int layernum) { m_layernum = layernum; }; 45 void setLayerNum(int layernum) { m_layernum = layernum; };
46 int getLayerNum() { return m_layernum; }; 46 int getLayerNum() { return m_layernum; };
47 void restack();
48 // Put all items on the same layer (called when layer item added to) 47 // Put all items on the same layer (called when layer item added to)
49 void alignItem(XLayerItem &item); 48 void alignItem(XLayerItem &item);
50 int countWindows(); 49 int countWindows();
@@ -73,9 +72,11 @@ public:
73 void moveToLayer(XLayerItem &item, int layernum); 72 void moveToLayer(XLayerItem &item, int layernum);
74 73
75private: 74private:
75 void restack();
76
76 MultLayers &m_manager; 77 MultLayers &m_manager;
77 int m_layernum; 78 int m_layernum;
78 79 bool m_needs_restack;
79}; 80};
80 81
81} // namespace FbTk 82} // namespace FbTk