all repos — fluxbox @ 32a6aa1f54bbb32f358cfa543288ac6ae33409a4

custom fork of the fluxbox windowmanager

less flicker
fluxgen fluxgen
commit

32a6aa1f54bbb32f358cfa543288ac6ae33409a4

parent

ce1852c29324e921363882da2f6cb7c24b656fe4

2 files changed, 43 insertions(+), 43 deletions(-)

jump to
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.50 2003/09/12 23:38:50 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.51 2003/09/14 10:32:31 fluxgen Exp $ #include "FbWinFrame.hh"

@@ -212,24 +212,19 @@ if (width != FbWinFrame::width() || height != FbWinFrame::height())

resize(width, height); } -void FbWinFrame::setTitle(const std::string &titletext) { - m_titletext = titletext; - redrawTitle(); -} - void FbWinFrame::setFocus(bool newvalue) { - if (m_focused == newvalue) // no need to change focus + if (m_focused == newvalue) return; - - - if (m_focused && !newvalue && currentLabel()) { - renderButtonUnfocus(*m_current_label); - } else if (!m_focused && newvalue && currentLabel()) { - renderButtonFocus(*m_current_label); + if (currentLabel()) { + if (newvalue) // focused + renderButtonFocus(*m_current_label); + else // unfocused + renderButtonUnfocus(*m_current_label); } m_focused = newvalue; + renderButtons(); renderHandles(); }

@@ -243,7 +238,7 @@ if (btn == 0) // valid button?

return; setupButton(*btn); // setup theme and other stuff - + m_buttons_left.push_back(btn); }

@@ -332,12 +327,13 @@ redrawTitle();

} void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) { + if (&btn == currentLabel()) + return; LabelList::iterator it = find(m_labelbuttons.begin(), m_labelbuttons.end(), &btn); if (it == m_labelbuttons.end()) return; - // render label buttons if (currentLabel() != 0)

@@ -703,13 +699,16 @@ // the same size for inside width so we can fit all buttons into label

(*btn_it)->moveResize(last_x - border_width, - border_width, button_width, label().height() + border_width); - (*btn_it)->clear(); - (*btn_it)->updateTransparent(); + if (isVisible()) + (*btn_it)->clear(); + } + + if (isVisible()) { + m_titlebar.clear(); + m_titlebar.updateTransparent(); + m_label.clear(); + m_label.updateTransparent(); } - m_titlebar.clear(); - m_titlebar.updateTransparent(); - m_label.clear(); - m_label.updateTransparent(); } void FbWinFrame::redrawTitlebar() {

@@ -868,15 +867,9 @@ m_grip_right.setBackgroundColor(m_grip_unfocused_color);

} } - m_grip_left.clear(); m_grip_left.setAlpha(theme().alpha()); - m_grip_left.updateTransparent(); - m_grip_right.clear(); m_grip_right.setAlpha(theme().alpha()); - m_grip_right.updateTransparent(); - m_handle.clear(); m_handle.setAlpha(theme().alpha()); - m_handle.updateTransparent(); }

@@ -885,7 +878,7 @@ if (!m_visible) return;

render(m_theme.buttonFocusTexture(), m_button_color, m_button_pm, m_button_size, m_button_size); - + render(m_theme.buttonUnfocusTexture(), m_button_unfocused_color, m_button_unfocused_pm, m_button_size, m_button_size);

@@ -895,12 +888,22 @@ m_button_pressed_pm,

m_button_size, m_button_size); // setup left and right buttons - for (size_t i=0; i < m_buttons_left.size(); ++i) + for (size_t i=0; i < m_buttons_left.size(); ++i) { setupButton(*m_buttons_left[i]); + if (isVisible()) { + m_buttons_left[i]->clear(); + m_buttons_left[i]->updateTransparent(); + } + } - for (size_t i=0; i < m_buttons_right.size(); ++i) + for (size_t i=0; i < m_buttons_right.size(); ++i) { setupButton(*m_buttons_right[i]); - + if (isVisible()) { + m_buttons_right[i]->clear(); + m_buttons_right[i]->updateTransparent(); + } + } + } void FbWinFrame::init() {

@@ -935,36 +938,33 @@

// Note: we don't show clientarea yet setEventHandler(*this); - // reconfigure(); } /** Setups upp background, pressed pixmap/color of the button to current theme */ void FbWinFrame::setupButton(FbTk::Button &btn) { - if (m_button_pressed_pm) { + if (m_button_pressed_pm) btn.setPressedPixmap(m_button_pressed_pm); - } //!! TODO button pressed color - if (m_focused) { + if (focused()) { // focused btn.setGC(m_theme.buttonPicFocusGC()); if (m_button_pm) btn.setBackgroundPixmap(m_button_pm); else btn.setBackgroundColor(m_button_color); - } else { + } else { // unfocused btn.setGC(m_theme.buttonPicUnfocusGC()); if (m_button_unfocused_pm) btn.setBackgroundPixmap(m_button_unfocused_pm); else - btn.setBackgroundColor(m_button_color); + btn.setBackgroundColor(m_button_unfocused_color); } btn.setAlpha(theme().alpha()); - btn.clear(); } void FbWinFrame::render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm,

@@ -1089,7 +1089,6 @@ } else

button.setBackgroundColor(m_label_focused_color); button.clear(); - button.updateTransparent(); } void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) {

@@ -1107,7 +1106,6 @@ } else

button.setBackgroundColor(m_label_unfocused_color); button.clear(); - button.updateTransparent(); } void FbWinFrame::updateTransparent() {

@@ -1127,8 +1125,11 @@ (*button_it)->clear();

(*button_it)->updateTransparent(); } + m_grip_left.clear(); m_grip_left.updateTransparent(); + m_grip_right.clear(); m_grip_right.updateTransparent(); + m_handle.clear(); m_handle.updateTransparent(); }
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.19 2003/09/12 23:38:50 fluxgen Exp $ +// $Id: FbWinFrame.hh,v 1.20 2003/09/14 10:32:31 fluxgen Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH

@@ -81,8 +81,7 @@ void resize(unsigned int width, unsigned int height);

/// resize client to specified size and resize frame to it void resizeForClient(unsigned int width, unsigned int height); void moveResize(int x, int y, unsigned int width, unsigned int height); - /// sets title on the titlebar label - void setTitle(const std::string &title); + /// set focus/unfocus style void setFocus(bool newvalue); void setDoubleClickTime(unsigned int time);