summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-04-18 21:17:36 (GMT)
committerfluxgen <fluxgen>2004-04-18 21:17:36 (GMT)
commit23d9630f076892e01722141ccde03f9621e68f71 (patch)
tree5d0d784c6af6a56b4e1285e731d1aabf05ebd3b2
parent5fb30d4bfc04206367bc46fee6c22fd3835721cf (diff)
downloadfluxbox_lack-23d9630f076892e01722141ccde03f9621e68f71.zip
fluxbox_lack-23d9630f076892e01722141ccde03f9621e68f71.tar.bz2
fixed remember on decoration when we get mwm hint event, patch from Mathias Gumz
-rw-r--r--src/Window.cc25
-rw-r--r--src/Window.hh5
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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.280 2004/04/14 16:38:33 rathnor Exp $ 25// $Id: Window.cc,v 1.281 2004/04/18 21:17:36 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -40,6 +40,7 @@
40#include "WinButton.hh" 40#include "WinButton.hh"
41#include "WinButtonTheme.hh" 41#include "WinButtonTheme.hh"
42#include "SendToMenu.hh" 42#include "SendToMenu.hh"
43#include "Remember.hh"
43 44
44#include "FbTk/StringUtil.hh" 45#include "FbTk/StringUtil.hh"
45#include "FbTk/TextButton.hh" 46#include "FbTk/TextButton.hh"
@@ -283,6 +284,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
283 m_current_state(0), 284 m_current_state(0),
284 m_old_decoration(DECOR_NORMAL), 285 m_old_decoration(DECOR_NORMAL),
285 m_client(&client), 286 m_client(&client),
287 m_toggled_decos(false),
286 m_shaped(false), 288 m_shaped(false),
287 m_icon_hidden(false), 289 m_icon_hidden(false),
288 m_old_pos_x(0), m_old_pos_y(0), 290 m_old_pos_x(0), m_old_pos_y(0),
@@ -1044,7 +1046,7 @@ void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) {
1044 1046
1045 if (!hint) return; 1047 if (!hint) return;
1046 1048
1047 if (hint->flags & MwmHintsDecorations) { 1049 if (!m_toggled_decos && hint->flags & MwmHintsDecorations) {
1048 if (hint->decorations & MwmDecorAll) { 1050 if (hint->decorations & MwmDecorAll) {
1049 decorations.titlebar = decorations.handle = decorations.border = 1051 decorations.titlebar = decorations.handle = decorations.border =
1050 decorations.iconify = decorations.maximize = 1052 decorations.iconify = decorations.maximize =
@@ -1093,6 +1095,17 @@ void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) {
1093 } 1095 }
1094} 1096}
1095 1097
1098void FluxboxWindow::updateRememberStateFromClient(WinClient &client) {
1099#ifdef REMEMBER
1100 Remember* rem= const_cast<Remember*>(static_cast<const Remember*>(Fluxbox::instance()->getAtomHandler("remember")));
1101 Application* app= 0;
1102 if ( rem && (app= (const_cast<Remember*>(rem))->find(client)) ) {
1103 if ( !m_toggled_decos && rem->isRemembered(client, Remember::REM_DECOSTATE) )
1104 setDecorationMask(app->decostate);
1105 }
1106#endif // REMEMBER
1107}
1108
1096void FluxboxWindow::updateFunctions() { 1109void FluxboxWindow::updateFunctions() {
1097 if (!m_client) 1110 if (!m_client)
1098 return; 1111 return;
@@ -2253,14 +2266,16 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2253 } else if (atom == fbatoms->getMWMHintsAtom()) { 2266 } else if (atom == fbatoms->getMWMHintsAtom()) {
2254 client.updateMWMHints(); 2267 client.updateMWMHints();
2255 updateMWMHintsFromClient(client); 2268 updateMWMHintsFromClient(client);
2269 updateRememberStateFromClient(client);
2256 applyDecorations(); // update decorations (if they changed) 2270 applyDecorations(); // update decorations (if they changed)
2257 } else if (atom == fbatoms->getFluxboxHintsAtom()) { 2271 } else if (atom == fbatoms->getFluxboxHintsAtom()) {
2258 client.updateBlackboxHints(); 2272 client.updateBlackboxHints();
2259 updateBlackboxHintsFromClient(client); 2273 updateBlackboxHintsFromClient(client);
2260 if (client.getBlackboxHint() != 0 && 2274 if (client.getBlackboxHint() != 0 &&
2261 (client.getBlackboxHint()->flags & ATTRIB_DECORATION)) 2275 (client.getBlackboxHint()->flags & ATTRIB_DECORATION)) {
2276 updateRememberStateFromClient(client);
2262 applyDecorations(); // update decoration 2277 applyDecorations(); // update decoration
2263 2278 }
2264 } 2279 }
2265 break; 2280 break;
2266 } 2281 }
@@ -2754,6 +2769,8 @@ void FluxboxWindow::toggleDecoration() {
2754 if (isShaded()) 2769 if (isShaded())
2755 return; 2770 return;
2756 2771
2772 m_toggled_decos= true;
2773
2757 if (decorations.enabled) { //remove decorations 2774 if (decorations.enabled) { //remove decorations
2758 decorations.enabled = false; 2775 decorations.enabled = false;
2759 setDecoration(DECOR_NONE); 2776 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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.hh,v 1.111 2004/04/12 18:19:10 fluxgen Exp $ 25// $Id: Window.hh,v 1.112 2004/04/18 21:17:36 fluxgen Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -397,6 +397,7 @@ private:
397 void updateIconNameFromClient(WinClient &client); 397 void updateIconNameFromClient(WinClient &client);
398 void updateMWMHintsFromClient(WinClient &client); 398 void updateMWMHintsFromClient(WinClient &client);
399 void updateBlackboxHintsFromClient(const WinClient &client); 399 void updateBlackboxHintsFromClient(const WinClient &client);
400 void updateRememberStateFromClient(WinClient &client);
400 void saveBlackboxAttribs(); 401 void saveBlackboxAttribs();
401 void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1); 402 void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1);
402 403
@@ -477,6 +478,8 @@ private:
477 maximize, close, menu, sticky, shade, tab, enabled; 478 maximize, close, menu, sticky, shade, tab, enabled;
478 } decorations; 479 } decorations;
479 480
481 bool m_toggled_decos;
482
480 struct _functions { 483 struct _functions {
481 bool resize, move, iconify, maximize, close; 484 bool resize, move, iconify, maximize, close;
482 } functions; 485 } functions;