From 6c710ba3749fede5d9d2914f888498ec54b6ea31 Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 10 Jan 2005 08:10:17 +0000 Subject: fix position init from atom handlers --- ChangeLog | 3 +++ src/Window.cc | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45c0a47..4136939 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/Window.cc b/src/Window.cc index 4498428..109e0f3 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -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); } -- cgit v0.11.2