From 5a3f25cda17d5381873431a5404944b63176c966 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 12 Sep 2009 16:19:46 +0200 Subject: implemented visibility of titlebar buttons via the apps file --- ChangeLog | 5 +++++ src/Window.cc | 41 +++++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30cef63..bb758e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ (Format: Year/Month/Day) Changes for 1.1.2 +*09/09/12: + * Implemented visibility of titlebar buttons via the apps file (Mathias) + Window.cc + *09/06/28: * Allow matching screen number in ClientPattern (thanks Peter Hercek) ClientPattern.cc @@ -13,6 +17,7 @@ Changes for 1.1.2 Keys.cc * Revert to relative iconbar alignment when too many windows are open (Mark) FbTk/Container.cc + *09/05/26: * Fixed unexpected window focus changes under "focus follows mouse" (Jim) FocusControl.cc/hh Window.cc fluxbox.cc Screen.cc diff --git a/src/Window.cc b/src/Window.cc index d38fb8a..cb86723 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -2810,6 +2810,7 @@ void FluxboxWindow::setDecorationMask(unsigned int mask, bool apply) { decorations.shade = mask & WindowState::DECORM_SHADE; decorations.tab = mask & WindowState::DECORM_TAB; decorations.enabled = mask & WindowState::DECORM_ENABLED; + // we don't want to do this during initialization if (apply) applyDecorations(); @@ -3574,7 +3575,7 @@ void FluxboxWindow::updateButtons() { switch (dir[i]) { case WinButton::MINIMIZE: - if (isIconifiable()) { + if (isIconifiable() && (m_state.deco_mask & WindowState::DECORM_ICONIFY)) { winbtn = new WinButton(*this, m_button_theme, screen().pressedWinButtonTheme(), WinButton::MINIMIZE, @@ -3584,7 +3585,7 @@ void FluxboxWindow::updateButtons() { } break; case WinButton::MAXIMIZE: - if (isMaximizable()) { + if (isMaximizable() && (m_state.deco_mask & WindowState::DECORM_MAXIMIZE) ) { winbtn = new WinButton(*this, m_button_theme, screen().pressedWinButtonTheme(), dir[i], @@ -3597,7 +3598,7 @@ void FluxboxWindow::updateButtons() { } break; case WinButton::CLOSE: - if (m_client->isClosable()) { + if (m_client->isClosable() && (m_state.deco_mask & WindowState::DECORM_CLOSE)) { winbtn = new WinButton(*this, m_button_theme, screen().pressedWinButtonTheme(), dir[i], @@ -3609,23 +3610,27 @@ void FluxboxWindow::updateButtons() { } break; case WinButton::STICK: - winbtn = new WinButton(*this, m_button_theme, - screen().pressedWinButtonTheme(), - dir[i], - frame().titlebar(), - 0, 0, 10, 10); - - stateSig().attach(winbtn); - winbtn->setOnClick(stick_cmd); + if (m_state.deco_mask & WindowState::DECORM_STICKY) { + winbtn = new WinButton(*this, m_button_theme, + screen().pressedWinButtonTheme(), + dir[i], + frame().titlebar(), + 0, 0, 10, 10); + + stateSig().attach(winbtn); + winbtn->setOnClick(stick_cmd); + } break; case WinButton::SHADE: - winbtn = new WinButton(*this, m_button_theme, - screen().pressedWinButtonTheme(), - dir[i], - frame().titlebar(), - 0, 0, 10, 10); - stateSig().attach(winbtn); - winbtn->setOnClick(shade_cmd); + if (m_state.deco_mask & WindowState::DECORM_SHADE) { + winbtn = new WinButton(*this, m_button_theme, + screen().pressedWinButtonTheme(), + dir[i], + frame().titlebar(), + 0, 0, 10, 10); + stateSig().attach(winbtn); + winbtn->setOnClick(shade_cmd); + } break; case WinButton::MENUICON: winbtn = new WinButton(*this, m_button_theme, -- cgit v0.11.2