shading works from epist

This commit is contained in:
Dana Jansens 2003-01-04 02:49:43 +00:00
parent 5f34069a3c
commit d9e7a7b8cd
2 changed files with 17 additions and 13 deletions

View file

@ -551,6 +551,7 @@ void OBClient::setDesktop(long target)
void OBClient::setState(StateAction action, long data1, long data2) void OBClient::setState(StateAction action, long data1, long data2)
{ {
const otk::OBProperty *property = Openbox::instance->property(); const otk::OBProperty *property = Openbox::instance->property();
bool restack = false, shadestate = _shaded;
if (!(action == State_Add || action == State_Remove || if (!(action == State_Add || action == State_Remove ||
action == State_Toggle)) action == State_Toggle))
@ -606,8 +607,8 @@ void OBClient::setState(StateAction action, long data1, long data2)
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_shaded)) { property->atom(otk::OBProperty::net_wm_state_shaded)) {
if (_shaded) continue; if (_shaded) continue;
_shaded = true; // shade when we're all thru here
// XXX: hide the client window shadestate = true;
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_skip_taskbar)) { property->atom(otk::OBProperty::net_wm_state_skip_taskbar)) {
_skip_taskbar = true; _skip_taskbar = true;
@ -618,17 +619,17 @@ void OBClient::setState(StateAction action, long data1, long data2)
property->atom(otk::OBProperty::net_wm_state_fullscreen)) { property->atom(otk::OBProperty::net_wm_state_fullscreen)) {
if (_fullscreen) continue; if (_fullscreen) continue;
_fullscreen = true; _fullscreen = true;
// XXX: raise the window n shit restack = false;
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_above)) { property->atom(otk::OBProperty::net_wm_state_above)) {
if (_above) continue; if (_above) continue;
_above = true; _above = true;
// XXX: raise the window n shit restack = true;
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_below)) { property->atom(otk::OBProperty::net_wm_state_below)) {
if (_below) continue; if (_below) continue;
_below = true; _below = true;
// XXX: lower the window n shit restack = true;
} }
} else { // action == State_Remove } else { // action == State_Remove
@ -648,8 +649,8 @@ void OBClient::setState(StateAction action, long data1, long data2)
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_shaded)) { property->atom(otk::OBProperty::net_wm_state_shaded)) {
if (!_shaded) continue; if (!_shaded) continue;
_shaded = false; // unshade when we're all thru here
// XXX: show the client window shadestate = false;
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_skip_taskbar)) { property->atom(otk::OBProperty::net_wm_state_skip_taskbar)) {
_skip_taskbar = false; _skip_taskbar = false;
@ -660,22 +661,26 @@ void OBClient::setState(StateAction action, long data1, long data2)
property->atom(otk::OBProperty::net_wm_state_fullscreen)) { property->atom(otk::OBProperty::net_wm_state_fullscreen)) {
if (!_fullscreen) continue; if (!_fullscreen) continue;
_fullscreen = false; _fullscreen = false;
// XXX: lower the window to its proper layer restack = true;
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_above)) { property->atom(otk::OBProperty::net_wm_state_above)) {
if (!_above) continue; if (!_above) continue;
_above = false; _above = false;
// XXX: lower the window to its proper layer restack = true;
} else if (state == } else if (state ==
property->atom(otk::OBProperty::net_wm_state_below)) { property->atom(otk::OBProperty::net_wm_state_below)) {
if (!_below) continue; if (!_below) continue;
_below = false; _below = false;
// XXX: raise the window to its proper layer restack = true;
} }
} }
} }
if (shadestate != _shaded)
shade(shadestate);
if (restack) {
calcLayer(); calcLayer();
Openbox::instance->screen(_screen)->restack(true, this); // raise Openbox::instance->screen(_screen)->restack(true, this); // raise
}
} }

View file

@ -126,7 +126,6 @@ void OBFrame::adjustSize()
{ {
// XXX: only if not overridden or something!!! MORE LOGIC HERE!! // XXX: only if not overridden or something!!! MORE LOGIC HERE!!
_decorations = _client->decorations(); _decorations = _client->decorations();
_decorations = 0xffffffff;
// true/false for whether to show each element of the titlebar // true/false for whether to show each element of the titlebar
bool tit_i = false, tit_m = false, tit_s = false, tit_c = false; bool tit_i = false, tit_m = false, tit_s = false, tit_c = false;