fix some sizing issues with gravity fixes

This commit is contained in:
simonb 2006-07-04 13:20:04 +00:00
parent aa589f3bdc
commit c3846743fb
4 changed files with 11 additions and 12 deletions

View file

@ -1,6 +1,8 @@
(Format: Year/Month/Day) (Format: Year/Month/Day)
Changes for 1.0rc3: Changes for 1.0rc3:
*06/07/04: *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 * Auto-grouped windows using groups file didn't raise (Thanks ac2dc, bug
#1449608) #1449608)
Workspace.cc Workspace.cc

View file

@ -241,7 +241,7 @@ void FbWinFrame::resize(unsigned int width, unsigned int height) {
} }
// need an atomic moveresize where possible // 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 // total height for frame
if (resize) // these fns check if the elements are "on" 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) { 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) { void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) {

View file

@ -104,7 +104,7 @@ public:
// for when there needs to be an atomic move+resize operation // for when there needs to be an atomic move+resize operation
void moveResizeForClient(int x, int y, void moveResizeForClient(int x, int y,
unsigned int width, unsigned int height, 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 // can elect to ignore move or resize (mainly for use of move/resize individual functions
void moveResize(int x, int y, void moveResize(int x, int y,

View file

@ -495,11 +495,6 @@ void FluxboxWindow::init() {
decorations.tab = false; //no tab for this window 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); associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height, m_client->gravity(), m_client->old_bw);
Fluxbox::instance()->attachSignals(*this); Fluxbox::instance()->attachSignals(*this);
@ -543,8 +538,6 @@ void FluxboxWindow::init() {
wattrib.height = 1; wattrib.height = 1;
*/ */
// if we're a transient then we should be on the same layer as our parent // if we're a transient then we should be on the same layer as our parent
if (m_client->isTransient() && if (m_client->isTransient() &&
m_client->transientFor()->fbwindow() && m_client->transientFor()->fbwindow() &&
@ -561,9 +554,13 @@ void FluxboxWindow::init() {
} }
#endif // DEBUG #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) 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); screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
setWorkspace(m_workspace_number); setWorkspace(m_workspace_number);
@ -1376,7 +1373,7 @@ void FluxboxWindow::moveResizeForClient(int new_x, int new_y,
// magic to detect if moved during initialisation // magic to detect if moved during initialisation
if (!isInitialized()) if (!isInitialized())
m_old_pos_x = 1; 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); setFocusFlag(focused);
shaded = false; shaded = false;
sendConfigureNotify(); sendConfigureNotify();