summaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-07-20 18:05:40 (GMT)
committerrathnor <rathnor>2003-07-20 18:05:40 (GMT)
commit037bd174bfb107fef4657c949ce49c188090f3e7 (patch)
tree35d56080c76f4751946be2ddf95e4ce18e2a5bf2 /src/FbTk
parent8500132b0a05d22470e63cee1d16191ecb138ecf (diff)
downloadfluxbox_lack-037bd174bfb107fef4657c949ce49c188090f3e7.zip
fluxbox_lack-037bd174bfb107fef4657c949ce49c188090f3e7.tar.bz2
fix focus and raising for transient windows in particular
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.hh3
-rw-r--r--src/FbTk/MultLayers.cc8
-rw-r--r--src/FbTk/MultLayers.hh8
-rw-r--r--src/FbTk/XLayer.cc7
4 files changed, 20 insertions, 6 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index 9ab69b4..fba7ae2 100644
--- a/src/FbTk/Menu.hh
+++ b/src/FbTk/Menu.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.hh,v 1.21 2003/07/20 10:41:56 rathnor Exp $ 25// $Id: Menu.hh,v 1.22 2003/07/20 18:05:39 rathnor Exp $
26 26
27#ifndef FBTK_MENU_HH 27#ifndef FBTK_MENU_HH
28#define FBTK_MENU_HH 28#define FBTK_MENU_HH
@@ -37,7 +37,6 @@
37#include "RefCount.hh" 37#include "RefCount.hh"
38#include "Command.hh" 38#include "Command.hh"
39#include "Observer.hh" 39#include "Observer.hh"
40#include "XLayerItem.hh"
41#include "FbPixmap.hh" 40#include "FbPixmap.hh"
42#include "MenuTheme.hh" 41#include "MenuTheme.hh"
43 42
diff --git a/src/FbTk/MultLayers.cc b/src/FbTk/MultLayers.cc
index fea4dae..9e3272b 100644
--- a/src/FbTk/MultLayers.cc
+++ b/src/FbTk/MultLayers.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: MultLayers.cc,v 1.6 2003/02/18 15:08:12 rathnor Exp $ 23// $Id: MultLayers.cc,v 1.7 2003/07/20 18:05:39 rathnor Exp $
24 24
25#include "MultLayers.hh" 25#include "MultLayers.hh"
26#include "XLayer.hh" 26#include "XLayer.hh"
@@ -32,7 +32,9 @@ using namespace std;
32 32
33using namespace FbTk; 33using namespace FbTk;
34 34
35MultLayers::MultLayers(int numlayers) { 35MultLayers::MultLayers(int numlayers) :
36 m_lock(0)
37{
36 for (int i=0; i < numlayers; ++i) 38 for (int i=0; i < numlayers; ++i)
37 m_layers.push_back(new XLayer(*this, i)); 39 m_layers.push_back(new XLayer(*this, i));
38} 40}
@@ -150,6 +152,8 @@ void MultLayers::moveToLayer(XLayerItem &item, int layernum) {
150} 152}
151 153
152void MultLayers::restack() { 154void MultLayers::restack() {
155 if (!isUpdatable())
156 return;
153 157
154 int layernum=0, winnum=0, size = this->size(); 158 int layernum=0, winnum=0, size = this->size();
155 159
diff --git a/src/FbTk/MultLayers.hh b/src/FbTk/MultLayers.hh
index 5cfc731..29c80a8 100644
--- a/src/FbTk/MultLayers.hh
+++ b/src/FbTk/MultLayers.hh
@@ -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: MultLayers.hh,v 1.5 2003/02/09 14:11:14 rathnor Exp $ 23// $Id: MultLayers.hh,v 1.6 2003/07/20 18:05:40 rathnor Exp $
24 24
25#ifndef FBTK_MULTLAYERS_HH 25#ifndef FBTK_MULTLAYERS_HH
26#define FBTK_MULTLAYERS_HH 26#define FBTK_MULTLAYERS_HH
@@ -59,9 +59,15 @@ public:
59 XLayer *getLayer(size_t num); 59 XLayer *getLayer(size_t num);
60 const XLayer *getLayer(size_t num) const; 60 const XLayer *getLayer(size_t num) const;
61 61
62 inline bool isUpdatable() const { return m_lock == 0; }
63 inline void lock() { ++m_lock; }
64 inline void unlock() { if (--m_lock == 0) restack(); }
65
62private: 66private:
63 std::vector<XLayer *> m_layers; 67 std::vector<XLayer *> m_layers;
64 68
69 int m_lock;
70
65}; 71};
66 72
67}; 73};
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc
index 023a80d..8164444 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.8 2003/04/15 23:20:31 rathnor Exp $ 23// $Id: XLayer.cc,v 1.9 2003/07/20 18:05:40 rathnor Exp $
24 24
25#include "XLayer.hh" 25#include "XLayer.hh"
26#include "XLayerItem.hh" 26#include "XLayerItem.hh"
@@ -39,6 +39,9 @@ XLayer::~XLayer() {
39} 39}
40 40
41void XLayer::restack() { 41void XLayer::restack() {
42 if (!m_manager.isUpdatable())
43 return;
44
42 int num_windows = countWindows(); 45 int num_windows = countWindows();
43 46
44 // each LayerItem can contain several windows 47 // each LayerItem can contain several windows
@@ -78,6 +81,8 @@ int XLayer::countWindows() {
78 81
79// Stack all windows associated with 'item' below the 'above' item 82// Stack all windows associated with 'item' below the 'above' item
80void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) { 83void XLayer::stackBelowItem(XLayerItem *item, XLayerItem *above) {
84 if (!m_manager.isUpdatable())
85 return;
81 86
82 Window *winlist; 87 Window *winlist;
83 size_t winnum, size, num = item->numWindows(); 88 size_t winnum, size, num = item->numWindows();