disabled resizing shaded windows
This commit is contained in:
parent
d267acc8e0
commit
cd238a475b
4 changed files with 13 additions and 22 deletions
|
@ -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 <tomi@nomi.cz>)
|
||||
Slit.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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue