summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-28 14:00:48 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-28 14:00:48 (GMT)
commit2fcc0fd9e7b92dbb440fd67e34fdbab05be7d98d (patch)
treed93fde959e5db890062c9900734b2796c91183f3
parentf2c8868724ebcaa6afaac4a71093f77b7eeaa23f (diff)
downloadfluxbox_lack-2fcc0fd9e7b92dbb440fd67e34fdbab05be7d98d.zip
fluxbox_lack-2fcc0fd9e7b92dbb440fd67e34fdbab05be7d98d.tar.bz2
Changed workspace area signal to use the new signal system
-rw-r--r--ChangeLog4
-rw-r--r--src/Screen.cc5
-rw-r--r--src/Screen.hh4
-rw-r--r--src/Window.cc11
-rw-r--r--src/Window.hh3
-rw-r--r--src/fluxbox.cc22
-rw-r--r--src/fluxbox.hh3
7 files changed, 31 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 588033c..dc582ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1.2 2Changes for 1.1.2
3*08/09/28: 3*08/09/28:
4 * Change focused window signal to use the new signal system (Henrik) 4 * Changed workspace area signal to use the new signal system (Henrik)
5 Window.hh/cc, Screen.hh/cc, fluxbox.hh/cc
6 * Changed focused window signal to use the new signal system (Henrik)
5 FbTk/Signal.hh, FocusControl.cc, FocusableList.hh/cc, Screen.hh/cc 7 FbTk/Signal.hh, FocusControl.cc, FocusableList.hh/cc, Screen.hh/cc
6 Window.hh/cc, fluxbox.hh/cc 8 Window.hh/cc, fluxbox.hh/cc
7*08/09/25: 9*08/09/25:
diff --git a/src/Screen.cc b/src/Screen.cc
index fe5ee31..66ab0fd 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -339,7 +339,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
339 const string &screenname, 339 const string &screenname,
340 const string &altscreenname, 340 const string &altscreenname,
341 int scrn, int num_layers) : 341 int scrn, int num_layers) :
342 m_workspace_area_sig(*this), // workspace area signal
343 m_reconfigure_sig(*this), // reconfigure signal 342 m_reconfigure_sig(*this), // reconfigure signal
344 m_resize_sig(*this), 343 m_resize_sig(*this),
345 m_layermanager(num_layers), 344 m_layermanager(num_layers),
@@ -1453,7 +1452,7 @@ void BScreen::updateAvailableWorkspaceArea() {
1453 } 1452 }
1454 1453
1455 if (updated) 1454 if (updated)
1456 m_workspace_area_sig.notify(); 1455 m_workspace_area_sig.emit(*this);
1457} 1456}
1458 1457
1459void BScreen::addWorkspaceName(const char *name) { 1458void BScreen::addWorkspaceName(const char *name) {
@@ -1933,7 +1932,7 @@ void BScreen::updateSize() {
1933 1932
1934 // send resize notify 1933 // send resize notify
1935 m_resize_sig.notify(); 1934 m_resize_sig.notify();
1936 m_workspace_area_sig.notify(); 1935 m_workspace_area_sig.emit(*this);
1937 1936
1938 // move windows out of inactive heads 1937 // move windows out of inactive heads
1939 clearHeads(); 1938 clearHeads();
diff --git a/src/Screen.hh b/src/Screen.hh
index 269cf25..d25364a 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -219,7 +219,7 @@ public:
219 /// workspace names signal 219 /// workspace names signal
220 ScreenSignal &workspaceNamesSig() { return m_workspacenames_sig; } 220 ScreenSignal &workspaceNamesSig() { return m_workspacenames_sig; }
221 /// workspace area signal 221 /// workspace area signal
222 FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; } 222 ScreenSignal &workspaceAreaSig() { return m_workspace_area_sig; }
223 /// current workspace signal 223 /// current workspace signal
224 ScreenSignal &currentWorkspaceSig() { return m_currentworkspace_sig; } 224 ScreenSignal &currentWorkspaceSig() { return m_currentworkspace_sig; }
225 /// focused window signal 225 /// focused window signal
@@ -494,11 +494,11 @@ private:
494 const Strut* availableWorkspaceArea(int head) const; 494 const Strut* availableWorkspaceArea(int head) const;
495 495
496 ScreenSubject 496 ScreenSubject
497 m_workspace_area_sig, ///< workspace area changed signal
498 m_reconfigure_sig, ///< reconfigure signal 497 m_reconfigure_sig, ///< reconfigure signal
499 m_resize_sig; ///< resize signal 498 m_resize_sig; ///< resize signal
500 499
501 FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal 500 FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal
501 ScreenSignal m_workspace_area_sig; ///< workspace area changed signal
502 ScreenSignal m_iconlist_sig; ///< notify if a window gets iconified/deiconified 502 ScreenSignal m_iconlist_sig; ///< notify if a window gets iconified/deiconified
503 ScreenSignal m_clientlist_sig; ///< client signal 503 ScreenSignal m_clientlist_sig; ///< client signal
504 ScreenSignal m_bg_change_sig; ///< background change signal 504 ScreenSignal m_bg_change_sig; ///< background change signal
diff --git a/src/Window.cc b/src/Window.cc
index 7e5a273..cd0e708 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1488,9 +1488,10 @@ void FluxboxWindow::attachWorkAreaSig() {
1488 // notify when struts change, so we can resize accordingly 1488 // notify when struts change, so we can resize accordingly
1489 // Subject checks for duplicates for us 1489 // Subject checks for duplicates for us
1490 if (m_state.maximized || m_state.fullscreen) 1490 if (m_state.maximized || m_state.fullscreen)
1491 screen().workspaceAreaSig().attach(this); 1491 join(screen().workspaceAreaSig(),
1492 FbTk::MemFun(*this, &FluxboxWindow::workspaceAreaChanged));
1492 else 1493 else
1493 screen().workspaceAreaSig().detach(this); 1494 leave(screen().workspaceAreaSig());
1494} 1495}
1495 1496
1496/** 1497/**
@@ -2729,14 +2730,16 @@ void FluxboxWindow::update(FbTk::Subject *subj) {
2729 } else if (subj == &m_theme.reconfigSig()) { 2730 } else if (subj == &m_theme.reconfigSig()) {
2730 frame().applyDecorations(); 2731 frame().applyDecorations();
2731 sendConfigureNotify(); 2732 sendConfigureNotify();
2732 } else if (subj == &screen().workspaceAreaSig()) {
2733 frame().applyState();
2734 } else if (m_initialized && subj == &m_frame.frameExtentSig()) { 2733 } else if (m_initialized && subj == &m_frame.frameExtentSig()) {
2735 Fluxbox::instance()->updateFrameExtents(*this); 2734 Fluxbox::instance()->updateFrameExtents(*this);
2736 sendConfigureNotify(); 2735 sendConfigureNotify();
2737 } 2736 }
2738} 2737}
2739 2738
2739void FluxboxWindow::workspaceAreaChanged(BScreen &screen) {
2740 frame().applyState();
2741}
2742
2740// commit current decoration values to actual displayed things 2743// commit current decoration values to actual displayed things
2741void FluxboxWindow::applyDecorations() { 2744void FluxboxWindow::applyDecorations() {
2742 frame().setDecorationMask(decorationMask()); 2745 frame().setDecorationMask(decorationMask());
diff --git a/src/Window.hh b/src/Window.hh
index e5e5c1f..27901d2 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -526,6 +526,9 @@ private:
526 void associateClient(WinClient &client); 526 void associateClient(WinClient &client);
527 /// Called when focused changed, and is attached when it is not in fullscreen mode 527 /// Called when focused changed, and is attached when it is not in fullscreen mode
528 void focusedWindowChanged(BScreen &screen, FluxboxWindow *focused_win, WinClient* client); 528 void focusedWindowChanged(BScreen &screen, FluxboxWindow *focused_win, WinClient* client);
529 /// Called when workspace area on screen changed.
530 void workspaceAreaChanged(BScreen &screen);
531
529 532
530 // state and hint signals 533 // state and hint signals
531 WinSubject m_hintsig, 534 WinSubject m_hintsig,
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 4041444..b83fa9c 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -453,7 +453,9 @@ void Fluxbox::initScreen(BScreen *screen) {
453 screen->initWindows(); 453 screen->initWindows();
454 454
455 // attach screen signals to this 455 // attach screen signals to this
456 screen->workspaceAreaSig().attach(this); 456
457 join(screen->workspaceAreaSig(),
458 FbTk::MemFun(*this, &Fluxbox::workspaceAreaChanged));
457 459
458 join(screen->focusedWindowSig(), 460 join(screen->focusedWindowSig(),
459 FbTk::MemFun(*this, &Fluxbox::focusedWindowChanged)); 461 FbTk::MemFun(*this, &Fluxbox::focusedWindowChanged));
@@ -1104,16 +1106,6 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
1104 } 1106 }
1105 1107
1106 screen.removeClient(*client); 1108 screen.removeClient(*client);
1107 } else if (typeid(*changedsub) == typeid(BScreen::ScreenSubject)) {
1108 BScreen::ScreenSubject *subj = dynamic_cast<BScreen::ScreenSubject *>(changedsub);
1109 BScreen &screen = subj->screen();
1110 if ((&(screen.workspaceAreaSig())) == changedsub) {
1111 for (AtomHandlerContainerIt it= m_atomhandler.begin();
1112 it != m_atomhandler.end(); ++it) {
1113 if ((*it).first->update())
1114 (*it).first->updateWorkarea(screen);
1115 }
1116 }
1117 } 1109 }
1118} 1110}
1119 1111
@@ -1540,3 +1532,11 @@ void Fluxbox::focusedWindowChanged(BScreen &screen,
1540 (*it).first->updateFocusedWindow(screen, client ? client->window() : 0 ); 1532 (*it).first->updateFocusedWindow(screen, client ? client->window() : 0 );
1541 } 1533 }
1542} 1534}
1535
1536void Fluxbox::workspaceAreaChanged(BScreen &screen) {
1537 for (AtomHandlerContainerIt it= m_atomhandler.begin();
1538 it != m_atomhandler.end(); ++it) {
1539 if ((*it).first->update())
1540 (*it).first->updateWorkarea(screen);
1541 }
1542}
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 4cf0555..6082b25 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -214,6 +214,9 @@ private:
214 FluxboxWindow* win, 214 FluxboxWindow* win,
215 WinClient* client); 215 WinClient* client);
216 216
217 /// Called when the workspace area changed.
218 void workspaceAreaChanged(BScreen &screen);
219
217 std::auto_ptr<FbAtoms> m_fbatoms; 220 std::auto_ptr<FbAtoms> m_fbatoms;
218 221
219 FbTk::ResourceManager m_resourcemanager, &m_screen_rm; 222 FbTk::ResourceManager m_resourcemanager, &m_screen_rm;