diff options
author | markt <markt> | 2007-02-04 18:44:28 (GMT) |
---|---|---|
committer | markt <markt> | 2007-02-04 18:44:28 (GMT) |
commit | cf6e471fbf027a1ba08693d6562ae5d63aaa9e24 (patch) | |
tree | 04551a7cf762ad72858ea9937ddd48ffc760d6f4 /src | |
parent | 07a3b3939bbdfa084f91c07984fdc60c2696a213 (diff) | |
download | fluxbox_paul-cf6e471fbf027a1ba08693d6562ae5d63aaa9e24.zip fluxbox_paul-cf6e471fbf027a1ba08693d6562ae5d63aaa9e24.tar.bz2 |
fix remembered layer and layer menu
Diffstat (limited to 'src')
-rw-r--r-- | src/LayerMenu.cc | 7 | ||||
-rw-r--r-- | src/LayerMenu.hh | 9 | ||||
-rw-r--r-- | src/Window.cc | 10 | ||||
-rw-r--r-- | src/Window.hh | 2 |
4 files changed, 18 insertions, 10 deletions
diff --git a/src/LayerMenu.cc b/src/LayerMenu.cc index 86e6dec..4a02214 100644 --- a/src/LayerMenu.cc +++ b/src/LayerMenu.cc | |||
@@ -65,3 +65,10 @@ LayerMenu::LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, | |||
65 | } | 65 | } |
66 | updateMenu(); | 66 | updateMenu(); |
67 | } | 67 | } |
68 | |||
69 | // update which items appear disabled whenever we show the menu | ||
70 | void LayerMenu::show() { | ||
71 | frameWindow().updateBackground(false); | ||
72 | clearWindow(); | ||
73 | FbTk::Menu::show(); | ||
74 | } | ||
diff --git a/src/LayerMenu.hh b/src/LayerMenu.hh index 3f8330f..fcc4edb 100644 --- a/src/LayerMenu.hh +++ b/src/LayerMenu.hh | |||
@@ -41,11 +41,12 @@ public: | |||
41 | /// this class holds the layermenu items | 41 | /// this class holds the layermenu items |
42 | class LayerMenuItem : public FbTk::MenuItem { | 42 | class LayerMenuItem : public FbTk::MenuItem { |
43 | public: | 43 | public: |
44 | LayerMenuItem(const FbTk::FbString &label, LayerObject *object, int layernum, | 44 | LayerMenuItem(const FbTk::FbString &label, LayerObject *object, |
45 | FbTk::RefCount<FbTk::Command> &cmd): | 45 | int layernum, FbTk::RefCount<FbTk::Command> &cmd): |
46 | FbTk::MenuItem(label, cmd), m_object(object), m_layernum(layernum) {} | 46 | FbTk::MenuItem(label, cmd), m_object(object), m_layernum(layernum) {} |
47 | 47 | ||
48 | LayerMenuItem(const FbTk::FbString &label, LayerObject *object, int layernum): | 48 | LayerMenuItem(const FbTk::FbString &label, LayerObject *object, |
49 | int layernum): | ||
49 | FbTk::MenuItem(label), m_object(object), m_layernum(layernum) {} | 50 | FbTk::MenuItem(label), m_object(object), m_layernum(layernum) {} |
50 | 51 | ||
51 | bool isEnabled() const { return m_object->layerNumber() != m_layernum; } | 52 | bool isEnabled() const { return m_object->layerNumber() != m_layernum; } |
@@ -65,7 +66,7 @@ class LayerMenu : public ToggleMenu { | |||
65 | public: | 66 | public: |
66 | LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, | 67 | LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, |
67 | FbTk::XLayer &layer, LayerObject *item, bool save_rc); | 68 | FbTk::XLayer &layer, LayerObject *item, bool save_rc); |
68 | 69 | void show(); | |
69 | }; | 70 | }; |
70 | 71 | ||
71 | #endif // LAYERMENU_HH | 72 | #endif // LAYERMENU_HH |
diff --git a/src/Window.cc b/src/Window.cc index df08744..1b3ef2f 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -497,7 +497,7 @@ void FluxboxWindow::init() { | |||
497 | m_client->transientFor()->fbwindow() != this) | 497 | m_client->transientFor()->fbwindow() != this) |
498 | layerItem().setLayer(m_client->transientFor()->fbwindow()->layerItem().getLayer()); | 498 | layerItem().setLayer(m_client->transientFor()->fbwindow()->layerItem().getLayer()); |
499 | else // if no parent then set default layer | 499 | else // if no parent then set default layer |
500 | moveToLayer(m_layernum); | 500 | moveToLayer(m_layernum, m_layernum != ::Layer::NORMAL); |
501 | #ifdef DEBUG | 501 | #ifdef DEBUG |
502 | cerr<<"FluxboxWindow::init("<<title()<<") transientFor: "<< | 502 | cerr<<"FluxboxWindow::init("<<title()<<") transientFor: "<< |
503 | m_client->transientFor()<<endl; | 503 | m_client->transientFor()<<endl; |
@@ -1934,7 +1934,7 @@ void FluxboxWindow::lowerLayer() { | |||
1934 | } | 1934 | } |
1935 | 1935 | ||
1936 | 1936 | ||
1937 | void FluxboxWindow::moveToLayer(int layernum) { | 1937 | void FluxboxWindow::moveToLayer(int layernum, bool force) { |
1938 | #ifdef DEBUG | 1938 | #ifdef DEBUG |
1939 | cerr<<"FluxboxWindow("<<title()<<")::moveToLayer("<<layernum<<")"<<endl; | 1939 | cerr<<"FluxboxWindow("<<title()<<")::moveToLayer("<<layernum<<")"<<endl; |
1940 | #endif // DEBUG | 1940 | #endif // DEBUG |
@@ -1948,7 +1948,7 @@ void FluxboxWindow::moveToLayer(int layernum) { | |||
1948 | if (!m_initialized) | 1948 | if (!m_initialized) |
1949 | m_layernum = layernum; | 1949 | m_layernum = layernum; |
1950 | 1950 | ||
1951 | if (m_layernum == layernum) | 1951 | if (m_layernum == layernum && !force) |
1952 | return; | 1952 | return; |
1953 | 1953 | ||
1954 | // get root window | 1954 | // get root window |
@@ -1963,9 +1963,9 @@ void FluxboxWindow::moveToLayer(int layernum) { | |||
1963 | 1963 | ||
1964 | if (!win->isIconic()) { | 1964 | if (!win->isIconic()) { |
1965 | if (layernum > m_layernum) | 1965 | if (layernum > m_layernum) |
1966 | screen().updateNetizenWindowRaise(client->window()); | ||
1967 | else | ||
1968 | screen().updateNetizenWindowLower(client->window()); | 1966 | screen().updateNetizenWindowLower(client->window()); |
1967 | else | ||
1968 | screen().updateNetizenWindowRaise(client->window()); | ||
1969 | } | 1969 | } |
1970 | win->layerItem().moveToLayer(layernum); | 1970 | win->layerItem().moveToLayer(layernum); |
1971 | // remember number just in case a transient happens to revisit this window | 1971 | // remember number just in case a transient happens to revisit this window |
diff --git a/src/Window.hh b/src/Window.hh index 50f756d..2cec115 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -245,7 +245,7 @@ public: | |||
245 | void tempRaise(); | 245 | void tempRaise(); |
246 | void raiseLayer(); | 246 | void raiseLayer(); |
247 | void lowerLayer(); | 247 | void lowerLayer(); |
248 | void moveToLayer(int layernum); | 248 | void moveToLayer(int layernum, bool force = false); |
249 | void setFocusHidden(bool value); | 249 | void setFocusHidden(bool value); |
250 | void setIconHidden(bool value); | 250 | void setIconHidden(bool value); |
251 | void reconfigure(); | 251 | void reconfigure(); |