fix position init from atom handlers

This commit is contained in:
simonb 2005-01-10 08:10:17 +00:00
parent a348c95326
commit 6c710ba374
2 changed files with 18 additions and 7 deletions

View file

@ -1,5 +1,8 @@
(Format: Year/Month/Day)
Changes for 0.9.12
*05/01/10:
* Fix position initialisation from apps file (Simon)
Window.cc
*05/01/05:
* Tidy up initialisation a bit better. Handlers can still use "action"
functions (e.g. stick()), but those functions should now check if

View file

@ -382,6 +382,8 @@ FluxboxWindow::~FluxboxWindow() {
void FluxboxWindow::init() {
m_attaching_tab = 0;
// magic to detect if moved by hints
m_old_pos_x = 0;
assert(m_client);
m_client->m_win = this;
@ -491,15 +493,11 @@ void FluxboxWindow::init() {
}
Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this);
Fluxbox::instance()->attachSignals(*this);
/**************************************************/
/* Read state above here, apply state below here. */
/**************************************************/
// this window is managed, we are now allowed to modify actual state
m_initialized = true;
// update transient infomation
m_client->updateTransientInfo();
@ -519,10 +517,16 @@ void FluxboxWindow::init() {
}
applyDecorations(true);
associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height);
Fluxbox::instance()->attachSignals(*this);
// this window is managed, we are now allowed to modify actual state
m_initialized = true;
applyDecorations(true);
grabButtons();
restoreAttributes();
@ -530,7 +534,7 @@ void FluxboxWindow::init() {
if (m_workspace_number < 0 || m_workspace_number >= screen().getCount())
m_workspace_number = screen().currentWorkspaceID();
bool place_window = true;
bool place_window = (m_old_pos_x == 0);
if (fluxbox.isStartup() || m_client->isTransient() ||
m_client->normal_hint_flags & (PPosition|USPosition)) {
@ -1340,6 +1344,10 @@ void FluxboxWindow::resize(unsigned int width, unsigned int height) {
void FluxboxWindow::moveResize(int new_x, int new_y,
unsigned int new_width, unsigned int new_height, int gravity) {
// magic to detect if moved during initialisation
if (!isInitialized())
m_old_pos_x = 1;
if (gravity != ForgetGravity) {
frame().gravityTranslate(new_x, new_y, gravity, false);
}