From c3846743fba060716b9090d3684fb273464ab2ae Mon Sep 17 00:00:00 2001 From: simonb Date: Tue, 4 Jul 2006 13:20:04 +0000 Subject: fix some sizing issues with gravity fixes --- ChangeLog | 2 ++ src/FbWinFrame.cc | 4 ++-- src/FbWinFrame.hh | 2 +- src/Window.cc | 15 ++++++--------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20ae1d7..f79d0ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: *06/07/04: + * Fix some sizing issues from gravity change patch (Simon) + FbWinFrame.hh/cc Window.cc * Auto-grouped windows using groups file didn't raise (Thanks ac2dc, bug #1449608) Workspace.cc diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 339c53e..0bf084f 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -241,7 +241,7 @@ void FbWinFrame::resize(unsigned int width, unsigned int height) { } // need an atomic moveresize where possible -void FbWinFrame::moveResizeForClient(int x, int y, unsigned int width, unsigned int height, bool move, bool resize, int win_gravity, unsigned int client_bw) { +void FbWinFrame::moveResizeForClient(int x, int y, unsigned int width, unsigned int height, int win_gravity, unsigned int client_bw, bool move, bool resize) { // total height for frame if (resize) // these fns check if the elements are "on" @@ -253,7 +253,7 @@ void FbWinFrame::moveResizeForClient(int x, int y, unsigned int width, unsigned } void FbWinFrame::resizeForClient(unsigned int width, unsigned int height, int win_gravity, unsigned int client_bw) { - moveResizeForClient(0, 0, width, height, false, true, win_gravity, client_bw); + moveResizeForClient(0, 0, width, height, win_gravity, client_bw, false, true); } void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) { diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index d128f23..26076ed 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -104,7 +104,7 @@ public: // for when there needs to be an atomic move+resize operation void moveResizeForClient(int x, int y, unsigned int width, unsigned int height, - bool move = true, bool resize = true, int win_gravity=ForgetGravity, unsigned int client_bw = 0); + int win_gravity=ForgetGravity, unsigned int client_bw = 0, bool move = true, bool resize = true); // can elect to ignore move or resize (mainly for use of move/resize individual functions void moveResize(int x, int y, diff --git a/src/Window.cc b/src/Window.cc index 39f82b6..80b7ef6 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -495,11 +495,6 @@ void FluxboxWindow::init() { decorations.tab = false; //no tab for this window } - - if (m_client->normal_hint_flags & (PPosition|USPosition)) { - frame().gravityTranslate(wattrib.x, wattrib.y, m_client->gravity(), m_client->old_bw, false); - } - associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height, m_client->gravity(), m_client->old_bw); Fluxbox::instance()->attachSignals(*this); @@ -543,8 +538,6 @@ void FluxboxWindow::init() { wattrib.height = 1; */ - - // if we're a transient then we should be on the same layer as our parent if (m_client->isTransient() && m_client->transientFor()->fbwindow() && @@ -561,9 +554,13 @@ void FluxboxWindow::init() { } #endif // DEBUG + int real_width = frame().width(); + int real_height = frame().height() - frame().titlebarHeight() - frame().handleHeight(); + m_client->applySizeHints(real_width, real_height); + real_height += frame().titlebarHeight() + frame().handleHeight(); if (!place_window) - moveResize(frame().x(), frame().y(), frame().width(), frame().height()); + moveResize(frame().x(), frame().y(), real_width, real_height); screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window); setWorkspace(m_workspace_number); @@ -1376,7 +1373,7 @@ void FluxboxWindow::moveResizeForClient(int new_x, int new_y, // magic to detect if moved during initialisation if (!isInitialized()) m_old_pos_x = 1; - frame().moveResizeForClient(new_x, new_y, new_width, new_height, true, true, gravity, client_bw); + frame().moveResizeForClient(new_x, new_y, new_width, new_height, gravity, client_bw); setFocusFlag(focused); shaded = false; sendConfigureNotify(); -- cgit v0.11.2