+void OBClient::getMwmHints()
+{
+ const otk::OBProperty *property = Openbox::instance->property();
+
+ unsigned long num;
+ MwmHints *hints;
+
+ num = MwmHints::elements;
+ if (!property->get(_window, otk::OBProperty::motif_wm_hints,
+ otk::OBProperty::motif_wm_hints, &num,
+ (unsigned long **)&hints))
+ return;
+
+ if (num < MwmHints::elements) {
+ delete [] hints;
+ return;
+ }
+
+ // retrieved the hints
+ // Mwm Hints are applied subtractively to what has already been chosen for
+ // decor and functionality
+
+ if (hints->flags & MwmFlag_Decorations) {
+ if (! (hints->decorations & MwmDecor_All)) {
+ if (! (hints->decorations & MwmDecor_Border))
+ _decorations &= ~Decor_Border;
+ if (! (hints->decorations & MwmDecor_Handle))
+ _decorations &= ~Decor_Handle;
+ if (! (hints->decorations & MwmDecor_Title))
+ _decorations &= ~Decor_Titlebar;
+ if (! (hints->decorations & MwmDecor_Iconify))
+ _decorations &= ~Decor_Iconify;
+ if (! (hints->decorations & MwmDecor_Maximize))
+ _decorations &= ~Decor_Maximize;
+ }
+ }
+
+ if (hints->flags & MwmFlag_Functions) {
+ if (! (hints->functions & MwmFunc_All)) {
+ if (! (hints->functions & MwmFunc_Resize))
+ _functions &= ~Func_Resize;
+ if (! (hints->functions & MwmFunc_Move))
+ _functions &= ~Func_Move;
+ if (! (hints->functions & MwmFunc_Iconify))
+ _functions &= ~Func_Iconify;
+ if (! (hints->functions & MwmFunc_Maximize))
+ _functions &= ~Func_Maximize;
+ //if (! (hints->functions & MwmFunc_Close))
+ // _functions &= ~Func_Close;
+ }
+ }
+ delete [] hints;
+}
+
+