all repos — fluxbox @ 42afb461691ab184263606d93809d0a11e5b8600

custom fork of the fluxbox windowmanager

avoid drawing the resize outline when not really resizing, caused flickering.
mathias mathias
commit

42afb461691ab184263606d93809d0a11e5b8600

parent

850d366dadf5c2b593026defb1a4711a77a8586b

2 files changed, 33 insertions(+), 18 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.15: +*05/10/04: + * Avoid drawing the resize outline if not really resizing (Mathias) + Window.cc *05/09/25: * added nls for "-screen" argument (Thanks php-coder) nls/*/Translation.m, nls/fluxbox-nls.hh
M src/Window.ccsrc/Window.cc

@@ -2824,14 +2824,14 @@ else

m_resize_corner = (me.y < cy) ? RIGHTTOP : RIGHTBOTTOM; startResizing(me.window, me.x, me.y); - } else if (resizing) { - // draw over old rect - parent().drawRectangle(screen().rootTheme().opGC(), - m_last_resize_x, m_last_resize_y, - m_last_resize_w - 1 + 2 * frame().window().borderWidth(), - m_last_resize_h - 1 + 2 * frame().window().borderWidth()); - + } else if (resizing) { + + int old_resize_x = m_last_resize_x; + int old_resize_y = m_last_resize_y; + int old_resize_w = m_last_resize_w; + int old_resize_h = m_last_resize_h; + // move rectangle int gx = 0, gy = 0;

@@ -2854,13 +2854,25 @@ }

fixsize(&gx, &gy); - // draw resize rectangle - parent().drawRectangle(screen().rootTheme().opGC(), - m_last_resize_x, m_last_resize_y, - m_last_resize_w - 1 + 2 * frame().window().borderWidth(), - m_last_resize_h - 1 + 2 * frame().window().borderWidth()); + if (old_resize_x != m_last_resize_x || + old_resize_y != m_last_resize_y || + old_resize_w != m_last_resize_w || + old_resize_h != m_last_resize_h ) { + + // draw over old rect + parent().drawRectangle(screen().rootTheme().opGC(), + old_resize_x, old_resize_y, + old_resize_w - 1 + 2 * frame().window().borderWidth(), + old_resize_h - 1 + 2 * frame().window().borderWidth()); - screen().showGeometry(gx, gy); + // draw resize rectangle + parent().drawRectangle(screen().rootTheme().opGC(), + m_last_resize_x, m_last_resize_y, + m_last_resize_w - 1 + 2 * frame().window().borderWidth(), + m_last_resize_h - 1 + 2 * frame().window().borderWidth()); + + screen().showGeometry(gx, gy); + } } } else if (functions.tabable && (me.state & Button2Mask) && inside_titlebar && (client != 0 || m_attaching_tab != 0)) {

@@ -3355,6 +3367,7 @@ }

void FluxboxWindow::startResizing(Window win, int x, int y) { + if (s_num_grabs > 0 || isShaded() || isIconic() ) return;

@@ -3379,18 +3392,17 @@ m_last_resize_h = frame().height();

fixsize(&gx, &gy); - screen().showGeometry(gx, gy); parent().drawRectangle(screen().rootTheme().opGC(), - m_last_resize_x, m_last_resize_y, - m_last_resize_w - 1 + 2 * frame().window().borderWidth(), - m_last_resize_h - 1 + 2 * frame().window().borderWidth()); + m_last_resize_x, m_last_resize_y, + m_last_resize_w - 1 + 2 * frame().window().borderWidth(), + m_last_resize_h - 1 + 2 * frame().window().borderWidth()); } void FluxboxWindow::stopResizing(bool interrupted) { resizing = false; - + parent().drawRectangle(screen().rootTheme().opGC(), m_last_resize_x, m_last_resize_y, m_last_resize_w - 1 + 2 * frame().window().borderWidth(),