aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2013-05-23 07:19:34 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-05-23 07:19:34 (GMT)
commitc6489ab1b1eba3dfedc6fb361f34180551396d1d (patch)
tree43f94ccab560923b33acc580ec5e9a946963052d /src/Window.cc
parent2da808667301d27110497e036b8cbdec6f65023d (diff)
downloadfluxbox-c6489ab1b1eba3dfedc6fb361f34180551396d1d.zip
fluxbox-c6489ab1b1eba3dfedc6fb361f34180551396d1d.tar.bz2
more compact code
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 9416978..c09cc24 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -229,8 +229,7 @@ bool isWindowVisibleOnSomeHeadOrScreen(FluxboxWindow const& w) {
229 229
230class SetClientCmd:public FbTk::Command<void> { 230class SetClientCmd:public FbTk::Command<void> {
231public: 231public:
232 explicit SetClientCmd(WinClient &client):m_client(client) { 232 explicit SetClientCmd(WinClient &client):m_client(client) { }
233 }
234 void execute() { 233 void execute() {
235 m_client.focus(); 234 m_client.focus();
236 } 235 }
@@ -480,7 +479,7 @@ void FluxboxWindow::init() {
480 // we must do this now, or else resizing may not work properly 479 // we must do this now, or else resizing may not work properly
481 applyDecorations(); 480 applyDecorations();
482 481
483 Fluxbox::instance()->attachSignals(*this); 482 fluxbox.attachSignals(*this);
484 483
485 // this window is managed, we are now allowed to modify actual state 484 // this window is managed, we are now allowed to modify actual state
486 m_initialized = true; 485 m_initialized = true;
@@ -489,25 +488,23 @@ void FluxboxWindow::init() {
489 m_workspace_number = screen().currentWorkspaceID(); 488 m_workspace_number = screen().currentWorkspaceID();
490 489
491 // if we're a transient then we should be on the same layer and workspace 490 // if we're a transient then we should be on the same layer and workspace
492 if (m_client->isTransient() && 491 FluxboxWindow* twin = m_client->transientFor() ? m_client->transientFor()->fbwindow() : 0;
493 m_client->transientFor()->fbwindow() && 492 if (twin && twin != this) {
494 m_client->transientFor()->fbwindow() != this) { 493 layerItem().setLayer(twin->layerItem().getLayer());
495 layerItem().setLayer(m_client->transientFor()->fbwindow()->layerItem().getLayer()); 494 m_state.layernum = twin->layerNum();
496 m_state.layernum = m_client->transientFor()->fbwindow()->layerNum(); 495 m_workspace_number = twin->workspaceNumber();
497 m_workspace_number =
498 m_client->transientFor()->fbwindow()->workspaceNumber();
499 } else // if no parent then set default layer 496 } else // if no parent then set default layer
500 moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL); 497 moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL);
501 498
502 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<< 499 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<<
503 m_client->transientFor()<<endl; 500 m_client->transientFor()<<endl;
504 if (m_client->transientFor() && m_client->transientFor()->fbwindow()) { 501 if (twin) {
505 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor->title(): "<< 502 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor->title(): "<<
506 m_client->transientFor()->fbwindow()->title().logical()<<endl; 503 twin->title().logical()<<endl;
507 } 504 }
508 505
509 506 unsigned int real_width = frame().width();
510 unsigned int real_width = frame().width(), real_height = frame().height(); 507 unsigned int real_height = frame().height();
511 frame().applySizeHints(real_width, real_height); 508 frame().applySizeHints(real_width, real_height);
512 509
513 screen().getWorkspace(m_workspace_number)->addWindow(*this); 510 screen().getWorkspace(m_workspace_number)->addWindow(*this);
@@ -555,14 +552,10 @@ void FluxboxWindow::init() {
555 } 552 }
556 553
557 m_workspacesig.emit(*this); 554 m_workspacesig.emit(*this);
558
559 m_creation_time = FbTk::FbTime::mono(); 555 m_creation_time = FbTk::FbTime::mono();
560
561 frame().frameExtentSig().emit(); 556 frame().frameExtentSig().emit();
562
563 setupWindow(); 557 setupWindow();
564 558 fluxbox.sync(false);
565 FbTk::App::instance()->sync(false);
566 559
567} 560}
568 561