aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2005-01-10 08:10:17 (GMT)
committersimonb <simonb>2005-01-10 08:10:17 (GMT)
commit6c710ba3749fede5d9d2914f888498ec54b6ea31 (patch)
tree5de5d18b6d2b626230c50c9a2e65e00641daa025 /src/Window.cc
parenta348c95326a21740019a7b9f2894e1b4af1df869 (diff)
downloadfluxbox-6c710ba3749fede5d9d2914f888498ec54b6ea31.zip
fluxbox-6c710ba3749fede5d9d2914f888498ec54b6ea31.tar.bz2
fix position init from atom handlers
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc22
1 files changed, 15 insertions, 7 deletions
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() {
382 382
383void FluxboxWindow::init() { 383void FluxboxWindow::init() {
384 m_attaching_tab = 0; 384 m_attaching_tab = 0;
385 // magic to detect if moved by hints
386 m_old_pos_x = 0;
385 387
386 assert(m_client); 388 assert(m_client);
387 m_client->m_win = this; 389 m_client->m_win = this;
@@ -491,15 +493,11 @@ void FluxboxWindow::init() {
491 } 493 }
492 494
493 Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this); 495 Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this);
494 Fluxbox::instance()->attachSignals(*this);
495 496
496 /**************************************************/ 497 /**************************************************/
497 /* Read state above here, apply state below here. */ 498 /* Read state above here, apply state below here. */
498 /**************************************************/ 499 /**************************************************/
499 500
500 // this window is managed, we are now allowed to modify actual state
501 m_initialized = true;
502
503 // update transient infomation 501 // update transient infomation
504 m_client->updateTransientInfo(); 502 m_client->updateTransientInfo();
505 503
@@ -519,10 +517,16 @@ void FluxboxWindow::init() {
519 } 517 }
520 518
521 519
522 applyDecorations(true);
523
524 associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height); 520 associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height);
525 521
522
523 Fluxbox::instance()->attachSignals(*this);
524
525 // this window is managed, we are now allowed to modify actual state
526 m_initialized = true;
527
528 applyDecorations(true);
529
526 grabButtons(); 530 grabButtons();
527 531
528 restoreAttributes(); 532 restoreAttributes();
@@ -530,7 +534,7 @@ void FluxboxWindow::init() {
530 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) 534 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount())
531 m_workspace_number = screen().currentWorkspaceID(); 535 m_workspace_number = screen().currentWorkspaceID();
532 536
533 bool place_window = true; 537 bool place_window = (m_old_pos_x == 0);
534 if (fluxbox.isStartup() || m_client->isTransient() || 538 if (fluxbox.isStartup() || m_client->isTransient() ||
535 m_client->normal_hint_flags & (PPosition|USPosition)) { 539 m_client->normal_hint_flags & (PPosition|USPosition)) {
536 540
@@ -1340,6 +1344,10 @@ void FluxboxWindow::resize(unsigned int width, unsigned int height) {
1340void FluxboxWindow::moveResize(int new_x, int new_y, 1344void FluxboxWindow::moveResize(int new_x, int new_y,
1341 unsigned int new_width, unsigned int new_height, int gravity) { 1345 unsigned int new_width, unsigned int new_height, int gravity) {
1342 1346
1347 // magic to detect if moved during initialisation
1348 if (!isInitialized())
1349 m_old_pos_x = 1;
1350
1343 if (gravity != ForgetGravity) { 1351 if (gravity != ForgetGravity) {
1344 frame().gravityTranslate(new_x, new_y, gravity, false); 1352 frame().gravityTranslate(new_x, new_y, gravity, false);
1345 } 1353 }