diff options
Diffstat (limited to 'src/FbTk/XLayerItem.cc')
-rw-r--r-- | src/FbTk/XLayerItem.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc index d822590..7f6f594 100644 --- a/src/FbTk/XLayerItem.cc +++ b/src/FbTk/XLayerItem.cc | |||
@@ -23,11 +23,13 @@ | |||
23 | #include "XLayerItem.hh" | 23 | #include "XLayerItem.hh" |
24 | #include "XLayer.hh" | 24 | #include "XLayer.hh" |
25 | 25 | ||
26 | #include <algorithm> | ||
27 | |||
26 | using namespace FbTk; | 28 | using namespace FbTk; |
27 | 29 | ||
28 | XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) : | 30 | XLayerItem::XLayerItem(FbWindow &win, XLayer &layer) : |
29 | m_layer(&layer) { | 31 | m_layer(&layer) { |
30 | m_windows.push_front(&win); | 32 | m_windows.push_back(&win); |
31 | m_layer->insert(*this); | 33 | m_layer->insert(*this); |
32 | } | 34 | } |
33 | 35 | ||
@@ -78,15 +80,15 @@ void XLayerItem::addWindow(FbWindow &win) { | |||
78 | } | 80 | } |
79 | 81 | ||
80 | void XLayerItem::removeWindow(FbWindow &win) { | 82 | void XLayerItem::removeWindow(FbWindow &win) { |
81 | // I'd like to think we can trust ourselves that it won't be added twice... | 83 | // I'd like to think we can trust ourselves that it won't be added twice... |
82 | // Otherwise we're always scanning through the list. | 84 | // Otherwise we're always scanning through the list. |
83 | 85 | ||
84 | XLayerItem::Windows::iterator it = std::find(m_windows.begin(), m_windows.end(), &win); | 86 | XLayerItem::Windows::iterator it = std::find(m_windows.begin(), m_windows.end(), &win); |
85 | if (it != m_windows.end()) | 87 | if (it != m_windows.end()) |
86 | m_windows.erase(it); | 88 | m_windows.erase(it); |
87 | } | 89 | } |
88 | 90 | ||
89 | void XLayerItem::bringToTop(FbWindow &win) { | 91 | void XLayerItem::bringToTop(FbWindow &win) { |
90 | removeWindow(win); | 92 | removeWindow(win); |
91 | addWindow(win); | 93 | addWindow(win); |
92 | } | 94 | } |