all repos — fluxbox @ 23d9630f076892e01722141ccde03f9621e68f71

custom fork of the fluxbox windowmanager

fixed remember on decoration when we get mwm hint event, patch from Mathias Gumz
fluxgen fluxgen
commit

23d9630f076892e01722141ccde03f9621e68f71

parent

5fb30d4bfc04206367bc46fee6c22fd3835721cf

2 files changed, 25 insertions(+), 5 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.280 2004/04/14 16:38:33 rathnor Exp $ +// $Id: Window.cc,v 1.281 2004/04/18 21:17:36 fluxgen Exp $ #include "Window.hh"

@@ -40,6 +40,7 @@ #include "FbWinFrame.hh"

#include "WinButton.hh" #include "WinButtonTheme.hh" #include "SendToMenu.hh" +#include "Remember.hh" #include "FbTk/StringUtil.hh" #include "FbTk/TextButton.hh"

@@ -283,6 +284,7 @@ m_workspace_number(0),

m_current_state(0), m_old_decoration(DECOR_NORMAL), m_client(&client), + m_toggled_decos(false), m_shaped(false), m_icon_hidden(false), m_old_pos_x(0), m_old_pos_y(0),

@@ -1044,7 +1046,7 @@ const WinClient::MwmHints *hint = client.getMwmHint();

if (!hint) return; - if (hint->flags & MwmHintsDecorations) { + if (!m_toggled_decos && hint->flags & MwmHintsDecorations) { if (hint->decorations & MwmDecorAll) { decorations.titlebar = decorations.handle = decorations.border = decorations.iconify = decorations.maximize =

@@ -1093,6 +1095,17 @@ }

} } +void FluxboxWindow::updateRememberStateFromClient(WinClient &client) { +#ifdef REMEMBER + Remember* rem= const_cast<Remember*>(static_cast<const Remember*>(Fluxbox::instance()->getAtomHandler("remember"))); + Application* app= 0; + if ( rem && (app= (const_cast<Remember*>(rem))->find(client)) ) { + if ( !m_toggled_decos && rem->isRemembered(client, Remember::REM_DECOSTATE) ) + setDecorationMask(app->decostate); + } +#endif // REMEMBER +} + void FluxboxWindow::updateFunctions() { if (!m_client) return;

@@ -2253,14 +2266,16 @@ client.updateWMProtocols();

} else if (atom == fbatoms->getMWMHintsAtom()) { client.updateMWMHints(); updateMWMHintsFromClient(client); + updateRememberStateFromClient(client); applyDecorations(); // update decorations (if they changed) } else if (atom == fbatoms->getFluxboxHintsAtom()) { client.updateBlackboxHints(); updateBlackboxHintsFromClient(client); if (client.getBlackboxHint() != 0 && - (client.getBlackboxHint()->flags & ATTRIB_DECORATION)) + (client.getBlackboxHint()->flags & ATTRIB_DECORATION)) { + updateRememberStateFromClient(client); applyDecorations(); // update decoration - + } } break; }

@@ -2753,6 +2768,8 @@ void FluxboxWindow::toggleDecoration() {

//don't toggle decor if the window is shaded if (isShaded()) return; + + m_toggled_decos= true; if (decorations.enabled) { //remove decorations decorations.enabled = false;
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.111 2004/04/12 18:19:10 fluxgen Exp $ +// $Id: Window.hh,v 1.112 2004/04/18 21:17:36 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -397,6 +397,7 @@ /// gets icon name from client window

void updateIconNameFromClient(WinClient &client); void updateMWMHintsFromClient(WinClient &client); void updateBlackboxHintsFromClient(const WinClient &client); + void updateRememberStateFromClient(WinClient &client); void saveBlackboxAttribs(); void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1);

@@ -476,6 +477,8 @@ struct _decorations {

bool titlebar, handle, border, iconify, maximize, close, menu, sticky, shade, tab, enabled; } decorations; + + bool m_toggled_decos; struct _functions { bool resize, move, iconify, maximize, close;