From d9e7a7b8cd667cc6e11add9062d3c12ef21b6fda Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 4 Jan 2003 02:49:43 +0000 Subject: [PATCH] shading works from epist --- src/client.cc | 29 +++++++++++++++++------------ src/frame.cc | 1 - 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/client.cc b/src/client.cc index d150cf8b..ac196f93 100644 --- a/src/client.cc +++ b/src/client.cc @@ -551,6 +551,7 @@ void OBClient::setDesktop(long target) void OBClient::setState(StateAction action, long data1, long data2) { const otk::OBProperty *property = Openbox::instance->property(); + bool restack = false, shadestate = _shaded; if (!(action == State_Add || action == State_Remove || action == State_Toggle)) @@ -606,8 +607,8 @@ void OBClient::setState(StateAction action, long data1, long data2) } else if (state == property->atom(otk::OBProperty::net_wm_state_shaded)) { if (_shaded) continue; - _shaded = true; - // XXX: hide the client window + // shade when we're all thru here + shadestate = true; } else if (state == property->atom(otk::OBProperty::net_wm_state_skip_taskbar)) { _skip_taskbar = true; @@ -618,17 +619,17 @@ void OBClient::setState(StateAction action, long data1, long data2) property->atom(otk::OBProperty::net_wm_state_fullscreen)) { if (_fullscreen) continue; _fullscreen = true; - // XXX: raise the window n shit + restack = false; } else if (state == property->atom(otk::OBProperty::net_wm_state_above)) { if (_above) continue; _above = true; - // XXX: raise the window n shit + restack = true; } else if (state == property->atom(otk::OBProperty::net_wm_state_below)) { if (_below) continue; _below = true; - // XXX: lower the window n shit + restack = true; } } else { // action == State_Remove @@ -648,8 +649,8 @@ void OBClient::setState(StateAction action, long data1, long data2) } else if (state == property->atom(otk::OBProperty::net_wm_state_shaded)) { if (!_shaded) continue; - _shaded = false; - // XXX: show the client window + // unshade when we're all thru here + shadestate = false; } else if (state == property->atom(otk::OBProperty::net_wm_state_skip_taskbar)) { _skip_taskbar = false; @@ -660,22 +661,26 @@ void OBClient::setState(StateAction action, long data1, long data2) property->atom(otk::OBProperty::net_wm_state_fullscreen)) { if (!_fullscreen) continue; _fullscreen = false; - // XXX: lower the window to its proper layer + restack = true; } else if (state == property->atom(otk::OBProperty::net_wm_state_above)) { if (!_above) continue; _above = false; - // XXX: lower the window to its proper layer + restack = true; } else if (state == property->atom(otk::OBProperty::net_wm_state_below)) { if (!_below) continue; _below = false; - // XXX: raise the window to its proper layer + restack = true; } } } - calcLayer(); - Openbox::instance->screen(_screen)->restack(true, this); // raise + if (shadestate != _shaded) + shade(shadestate); + if (restack) { + calcLayer(); + Openbox::instance->screen(_screen)->restack(true, this); // raise + } } diff --git a/src/frame.cc b/src/frame.cc index a1c40306..ee770b25 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -126,7 +126,6 @@ void OBFrame::adjustSize() { // XXX: only if not overridden or something!!! MORE LOGIC HERE!! _decorations = _client->decorations(); - _decorations = 0xffffffff; // true/false for whether to show each element of the titlebar bool tit_i = false, tit_m = false, tit_s = false, tit_c = false; -- 2.39.2