fix remembered layer and layer menu

This commit is contained in:
markt 2007-02-04 18:44:28 +00:00
parent 07a3b3939b
commit cf6e471fbf
5 changed files with 22 additions and 10 deletions

View file

@ -1,6 +1,10 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*07/02/04:
* Layer wasn't set properly on remembered windows, and the layer menu
wasn't getting updated properly, bugs #1535304, #1572683, #1646740
(Mark)
Window.cc/hh LayerMenu.cc/hh
* Clicking on the edge of a button didn't work, bugs #1060891, #1517747
(Mark)
FbTk/Button.cc

View file

@ -65,3 +65,10 @@ LayerMenu::LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl,
}
updateMenu();
}
// update which items appear disabled whenever we show the menu
void LayerMenu::show() {
frameWindow().updateBackground(false);
clearWindow();
FbTk::Menu::show();
}

View file

@ -41,11 +41,12 @@ public:
/// this class holds the layermenu items
class LayerMenuItem : public FbTk::MenuItem {
public:
LayerMenuItem(const FbTk::FbString &label, LayerObject *object, int layernum,
FbTk::RefCount<FbTk::Command> &cmd):
LayerMenuItem(const FbTk::FbString &label, LayerObject *object,
int layernum, FbTk::RefCount<FbTk::Command> &cmd):
FbTk::MenuItem(label, cmd), m_object(object), m_layernum(layernum) {}
LayerMenuItem(const FbTk::FbString &label, LayerObject *object, int layernum):
LayerMenuItem(const FbTk::FbString &label, LayerObject *object,
int layernum):
FbTk::MenuItem(label), m_object(object), m_layernum(layernum) {}
bool isEnabled() const { return m_object->layerNumber() != m_layernum; }
@ -65,7 +66,7 @@ class LayerMenu : public ToggleMenu {
public:
LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl,
FbTk::XLayer &layer, LayerObject *item, bool save_rc);
void show();
};
#endif // LAYERMENU_HH

View file

@ -497,7 +497,7 @@ void FluxboxWindow::init() {
m_client->transientFor()->fbwindow() != this)
layerItem().setLayer(m_client->transientFor()->fbwindow()->layerItem().getLayer());
else // if no parent then set default layer
moveToLayer(m_layernum);
moveToLayer(m_layernum, m_layernum != ::Layer::NORMAL);
#ifdef DEBUG
cerr<<"FluxboxWindow::init("<<title()<<") transientFor: "<<
m_client->transientFor()<<endl;
@ -1934,7 +1934,7 @@ void FluxboxWindow::lowerLayer() {
}
void FluxboxWindow::moveToLayer(int layernum) {
void FluxboxWindow::moveToLayer(int layernum, bool force) {
#ifdef DEBUG
cerr<<"FluxboxWindow("<<title()<<")::moveToLayer("<<layernum<<")"<<endl;
#endif // DEBUG
@ -1948,7 +1948,7 @@ void FluxboxWindow::moveToLayer(int layernum) {
if (!m_initialized)
m_layernum = layernum;
if (m_layernum == layernum)
if (m_layernum == layernum && !force)
return;
// get root window
@ -1963,9 +1963,9 @@ void FluxboxWindow::moveToLayer(int layernum) {
if (!win->isIconic()) {
if (layernum > m_layernum)
screen().updateNetizenWindowRaise(client->window());
else
screen().updateNetizenWindowLower(client->window());
else
screen().updateNetizenWindowRaise(client->window());
}
win->layerItem().moveToLayer(layernum);
// remember number just in case a transient happens to revisit this window

View file

@ -245,7 +245,7 @@ public:
void tempRaise();
void raiseLayer();
void lowerLayer();
void moveToLayer(int layernum);
void moveToLayer(int layernum, bool force = false);
void setFocusHidden(bool value);
void setIconHidden(bool value);
void reconfigure();