diff options
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/Window.cc b/src/Window.cc index fe3a43b..3452ce2 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "FocusControl.hh" | 44 | #include "FocusControl.hh" |
45 | #include "Layer.hh" | 45 | #include "Layer.hh" |
46 | #include "IconButton.hh" | 46 | #include "IconButton.hh" |
47 | #include "ScreenPlacement.hh" | ||
47 | 48 | ||
48 | #include "FbTk/Compose.hh" | 49 | #include "FbTk/Compose.hh" |
49 | #include "FbTk/EventManager.hh" | 50 | #include "FbTk/EventManager.hh" |
@@ -452,20 +453,6 @@ void FluxboxWindow::init() { | |||
452 | wattrib.width, wattrib.height, | 453 | wattrib.width, wattrib.height, |
453 | m_client->gravity(), m_client->old_bw); | 454 | m_client->gravity(), m_client->old_bw); |
454 | 455 | ||
455 | Fluxbox::instance()->attachSignals(*this); | ||
456 | |||
457 | // this window is managed, we are now allowed to modify actual state | ||
458 | m_initialized = true; | ||
459 | |||
460 | applyDecorations(true); | ||
461 | |||
462 | grabButtons(); | ||
463 | |||
464 | restoreAttributes(); | ||
465 | |||
466 | if (m_workspace_number >= screen().numberOfWorkspaces()) | ||
467 | m_workspace_number = screen().currentWorkspaceID(); | ||
468 | |||
469 | if (fluxbox.isStartup()) | 456 | if (fluxbox.isStartup()) |
470 | m_placed = true; | 457 | m_placed = true; |
471 | else if (m_client->isTransient() || | 458 | else if (m_client->isTransient() || |
@@ -480,9 +467,23 @@ void FluxboxWindow::init() { | |||
480 | real_y <= (signed) screen().height()) | 467 | real_y <= (signed) screen().height()) |
481 | m_placed = true; | 468 | m_placed = true; |
482 | 469 | ||
483 | } else if (!m_placed) { | 470 | } else |
484 | setOnHead(screen().getCurrHead()); | 471 | setOnHead(screen().getCurrHead()); |
485 | } | 472 | |
473 | Fluxbox::instance()->attachSignals(*this); | ||
474 | |||
475 | // this window is managed, we are now allowed to modify actual state | ||
476 | m_initialized = true; | ||
477 | |||
478 | applyDecorations(true); | ||
479 | |||
480 | grabButtons(); | ||
481 | |||
482 | restoreAttributes(); | ||
483 | |||
484 | if (m_workspace_number >= screen().numberOfWorkspaces()) | ||
485 | m_workspace_number = screen().currentWorkspaceID(); | ||
486 | |||
486 | /* | 487 | /* |
487 | if (wattrib.width <= 0) | 488 | if (wattrib.width <= 0) |
488 | wattrib.width = 1; | 489 | wattrib.width = 1; |
@@ -514,7 +515,8 @@ void FluxboxWindow::init() { | |||
514 | if (m_placed) | 515 | if (m_placed) |
515 | moveResize(frame().x(), frame().y(), real_width, real_height); | 516 | moveResize(frame().x(), frame().y(), real_width, real_height); |
516 | 517 | ||
517 | screen().getWorkspace(m_workspace_number)->addWindow(*this, !m_placed); | 518 | if (!m_placed) placeWindow(getOnHead()); |
519 | screen().getWorkspace(m_workspace_number)->addWindow(*this); | ||
518 | 520 | ||
519 | setFocusFlag(false); // update graphics before mapping | 521 | setFocusFlag(false); // update graphics before mapping |
520 | 522 | ||
@@ -4120,3 +4122,11 @@ void FluxboxWindow::setOnHead(int head) { | |||
4120 | m_placed = placed; | 4122 | m_placed = placed; |
4121 | } | 4123 | } |
4122 | } | 4124 | } |
4125 | |||
4126 | void FluxboxWindow::placeWindow(int head) { | ||
4127 | int place_x, place_y; | ||
4128 | // we ignore the return value, | ||
4129 | // the screen placement strategy is guaranteed to succeed. | ||
4130 | screen().placementStrategy().placeWindow(*this, head, place_x, place_y); | ||
4131 | move(place_x, place_y); | ||
4132 | } | ||