From 3737a18dadaefa7ad07eff3e34edb757ee9a2170 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sat, 23 Nov 2002 16:07:19 +0000 Subject: toggleDecor fix - rather than static, use an extra member of decorations (means that odd number of toggles don't cause the next window toggled to "ignore" it). I think this fixes bug [ 561602 ] Problem using ToggleDecor in terminals. --- src/Window.cc | 10 +++++----- src/Window.hh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index 1a8106a..24e4e45 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -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.100 2002/11/17 12:50:20 fluxgen Exp $ +// $Id: Window.cc,v 1.101 2002/11/23 16:07:19 rathnor Exp $ #include "Window.hh" @@ -94,6 +94,7 @@ tab(0) { blackbox_attrib.premax_w = blackbox_attrib.premax_h = 0; //use tab as default decorations.tab = true; + decorations.enabled = true; client.window = w; frame.window = frame.plate = frame.title = frame.handle = None; frame.right_grip = frame.left_grip = None; @@ -3175,17 +3176,16 @@ void FluxboxWindow::setDecoration(Decoration decoration) { } void FluxboxWindow::toggleDecoration() { - static bool decor = false; //don't toggle decor if the window is shaded if (isShaded()) return; - if (!decor) { //remove decorations + if (decorations.enabled) { //remove decorations setDecoration(DECOR_NONE); - decor = true; + decorations.enabled = false; } else { //revert back to old decoration setDecoration(old_decoration); - decor = false; + decorations.enabled = true; } } diff --git a/src/Window.hh b/src/Window.hh index 06a901c..7bc5901 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -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.36 2002/11/15 12:14:39 fluxgen Exp $ +// $Id: Window.hh,v 1.37 2002/11/23 16:07:19 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH @@ -278,7 +278,7 @@ private: struct _decorations { bool titlebar, handle, border, iconify, - maximize, close, menu, sticky, shade, tab; + maximize, close, menu, sticky, shade, tab, enabled; } decorations; struct _functions { -- cgit v0.11.2