From 23d9630f076892e01722141ccde03f9621e68f71 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 18 Apr 2004 21:17:36 +0000 Subject: fixed remember on decoration when we get mwm hint event, patch from Mathias Gumz --- src/Window.cc | 25 +++++++++++++++++++++---- src/Window.hh | 5 ++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index 25e60a3..0b306ef 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // 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 "WinButton.hh" #include "WinButtonTheme.hh" #include "SendToMenu.hh" +#include "Remember.hh" #include "FbTk/StringUtil.hh" #include "FbTk/TextButton.hh" @@ -283,6 +284,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm, 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 @@ void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) { 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::updateMWMHintsFromClient(WinClient &client) { } } +void FluxboxWindow::updateRememberStateFromClient(WinClient &client) { +#ifdef REMEMBER + Remember* rem= const_cast(static_cast(Fluxbox::instance()->getAtomHandler("remember"))); + Application* app= 0; + if ( rem && (app= (const_cast(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 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) { } 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; } @@ -2754,6 +2769,8 @@ void FluxboxWindow::toggleDecoration() { if (isShaded()) return; + m_toggled_decos= true; + if (decorations.enabled) { //remove decorations decorations.enabled = false; setDecoration(DECOR_NONE); diff --git a/src/Window.hh b/src/Window.hh index 6b5a411..68aff79 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -22,7 +22,7 @@ // 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 @@ private: 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); @@ -477,6 +478,8 @@ private: maximize, close, menu, sticky, shade, tab, enabled; } decorations; + bool m_toggled_decos; + struct _functions { bool resize, move, iconify, maximize, close; } functions; -- cgit v0.11.2