disabled resizing shaded windows
markt markt
4 files changed,
13 insertions(+),
22 deletions(-)
M
src/FbWinFrame.cc
→
src/FbWinFrame.cc
@@ -90,7 +90,6 @@ m_active_gravity(0),
m_active_orig_client_bw(0), m_need_render(true), m_button_size(1), - m_width_before_shade(1), m_height_before_shade(1), m_shaded(false), m_focused_alpha(0),@@ -232,7 +231,6 @@
// toggle shade m_shaded = !m_shaded; if (m_shaded) { // i.e. should be shaded now - m_width_before_shade = m_window.width(); m_height_before_shade = m_window.height(); m_window.resize(m_window.width(), m_titlebar.height()); alignTabs();@@ -240,7 +238,7 @@ // need to update our shape
if ( m_shape.get() ) m_shape->update(); } else { // should be unshaded - m_window.resize(m_width_before_shade, m_height_before_shade); + m_window.resize(m_window.width(), m_height_before_shade); reconfigure(); } }@@ -279,18 +277,12 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) {
if (move && x == window().x() && y == window().y()) move = false; - if (resize && width == FbWinFrame::width() && height == FbWinFrame::height()) + if (resize && (m_shaded || width == FbWinFrame::width() && + height == FbWinFrame::height())) resize = false; if (!move && !resize) return; - - if (resize && m_shaded) { - // update unshaded size if we're in shaded state and just resize width - m_width_before_shade = width; - m_height_before_shade = height; - height = m_window.height(); - } if (move && resize) { m_window.moveResize(x, y, width, height);
M
src/FbWinFrame.hh
→
src/FbWinFrame.hh
@@ -380,8 +380,7 @@ unsigned int m_active_orig_client_bw;
bool m_need_render; int m_button_size; ///< size for all titlebar buttons - unsigned int m_width_before_shade, ///< width before shade, so we can restore it when we unshade - m_height_before_shade; ///< height before shade, so we can restore it when we unshade + unsigned int m_height_before_shade; ///< height before shade, so we can restore it when we unshade bool m_shaded; ///< wheter we're shaded or not unsigned char m_focused_alpha; ///< focused alpha value unsigned char m_unfocused_alpha; ///< unfocused alpha value
M
src/Window.cc
→
src/Window.cc
@@ -1252,29 +1252,26 @@ }
// send_event is just an override void FluxboxWindow::moveResize(int new_x, int new_y, - unsigned int new_width, unsigned int new_height, bool send_event) { + unsigned int new_width, unsigned int new_height, + bool send_event) { // magic to detect if moved during initialisation if (!m_initialized) m_old_pos_x = 1; - send_event = send_event || (frame().x() != new_x || frame().y() != new_y); + send_event = send_event || frame().x() != new_x || frame().y() != new_y; + + if ((new_width != frame().width() || new_height != frame().height()) && + isResizable() && !isShaded()) { - if (new_width != frame().width() || new_height != frame().height()) { if ((((signed) frame().width()) + new_x) < 0) new_x = 0; if ((((signed) frame().height()) + new_y) < 0) new_y = 0; - if (!isResizable()) { - new_width = width(); - new_height = height(); - } - frame().moveResize(new_x, new_y, new_width, new_height); setFocusFlag(focused); - shaded = false; send_event = true; } else if (send_event) frame().move(new_x, new_y);