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

This commit is contained in:
fluxgen 2004-04-18 21:17:36 +00:00
parent 5fb30d4bfc
commit 23d9630f07
2 changed files with 25 additions and 5 deletions

View file

@ -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<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 @@ 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);

View file

@ -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;