From cd238a475b96806752a0d232c6b09d1627de58c1 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 23 Apr 2007 16:09:00 +0000 Subject: disabled resizing shaded windows --- ChangeLog | 3 +++ src/FbWinFrame.cc | 14 +++----------- src/FbWinFrame.hh | 3 +-- src/Window.cc | 15 ++++++--------- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2c2b13..a0bee7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0.0: +*07/04/23: + * Disabled resizing shaded windows (Mark) + FbWinFrame.cc Window.cc *07/04/20: * Fix slit.onhead with BOTTOMLEFT placement.(Thanks Tomas Janousek ) Slit.cc diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 68adc0f..adef30c 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -90,7 +90,6 @@ FbWinFrame::FbWinFrame(BScreen &screen, FbWinFrameTheme &theme, FbTk::ImageContr 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 @@ void FbWinFrame::shade() { // 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 @@ void FbWinFrame::shade() { 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,19 +277,13 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh 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); notifyMoved(false); // will reconfigure diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 2ea3542..8d0c3ba 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -380,8 +380,7 @@ private: 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 diff --git a/src/Window.cc b/src/Window.cc index a6fff7c..066d962 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1252,29 +1252,26 @@ void FluxboxWindow::resize(unsigned int width, unsigned int height) { // 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); -- cgit v0.11.2