summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-28 16:13:30 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-28 16:13:30 (GMT)
commit9aee5b80cb32119a633151a489a2bd85b63e3b28 (patch)
treeaaf370b73f2c9802eb804312ac64ade1a141b382 /src
parent2fcc0fd9e7b92dbb440fd67e34fdbab05be7d98d (diff)
downloadfluxbox_lack-9aee5b80cb32119a633151a489a2bd85b63e3b28.zip
fluxbox_lack-9aee5b80cb32119a633151a489a2bd85b63e3b28.tar.bz2
Changed resize signal in BScreen to use the new signal system
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc3
-rw-r--r--src/Screen.hh8
-rw-r--r--src/Slit.cc20
-rw-r--r--src/Slit.hh1
-rw-r--r--src/Toolbar.cc9
-rw-r--r--src/Toolbar.hh5
6 files changed, 32 insertions, 14 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 66ab0fd..a4778be 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -340,7 +340,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
340 const string &altscreenname, 340 const string &altscreenname,
341 int scrn, int num_layers) : 341 int scrn, int num_layers) :
342 m_reconfigure_sig(*this), // reconfigure signal 342 m_reconfigure_sig(*this), // reconfigure signal
343 m_resize_sig(*this),
344 m_layermanager(num_layers), 343 m_layermanager(num_layers),
345 m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")), 344 m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
346 m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")), 345 m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")),
@@ -1931,7 +1930,7 @@ void BScreen::updateSize() {
1931 m_root_theme->reconfigTheme(); 1930 m_root_theme->reconfigTheme();
1932 1931
1933 // send resize notify 1932 // send resize notify
1934 m_resize_sig.notify(); 1933 m_resize_sig.emit(*this);
1935 m_workspace_area_sig.emit(*this); 1934 m_workspace_area_sig.emit(*this);
1936 1935
1937 // move windows out of inactive heads 1936 // move windows out of inactive heads
diff --git a/src/Screen.hh b/src/Screen.hh
index d25364a..eb86b03 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -226,7 +226,7 @@ public:
226 FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; } 226 FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> &focusedWindowSig() { return m_focusedwindow_sig; }
227 /// reconfigure signal 227 /// reconfigure signal
228 FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } 228 FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; }
229 FbTk::Subject &resizeSig() { return m_resize_sig; } 229 ScreenSignal &resizeSig() { return m_resize_sig; }
230 ScreenSignal &bgChangeSig() { return m_bg_change_sig; } 230 ScreenSignal &bgChangeSig() { return m_bg_change_sig; }
231 //@} 231 //@}
232 232
@@ -493,11 +493,11 @@ private:
493 493
494 const Strut* availableWorkspaceArea(int head) const; 494 const Strut* availableWorkspaceArea(int head) const;
495 495
496 ScreenSubject 496 ScreenSubject m_reconfigure_sig; ///< reconfigure signal
497 m_reconfigure_sig, ///< reconfigure signal 497
498 m_resize_sig; ///< resize signal
499 498
500 FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal 499 FbTk::Signal<void, BScreen&, FluxboxWindow*, WinClient*> m_focusedwindow_sig; ///< focused window signal
500 ScreenSignal m_resize_sig; ///< resize signal
501 ScreenSignal m_workspace_area_sig; ///< workspace area changed 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
diff --git a/src/Slit.cc b/src/Slit.cc
index 6824bde..5bb96c4 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -265,7 +265,9 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
265 265
266 // attach to theme and root window change signal 266 // attach to theme and root window change signal
267 theme().reconfigSig().attach(this); 267 theme().reconfigSig().attach(this);
268 scr.resizeSig().attach(this); 268
269 join(scr.resizeSig(),
270 FbTk::MemFun(*this, &Slit::screenSizeChanged));
269 271
270 join(scr.bgChangeSig(), 272 join(scr.bgChangeSig(),
271 FbTk::MemFun(*this, &Slit::updateForScreen)); 273 FbTk::MemFun(*this, &Slit::updateForScreen));
@@ -1053,18 +1055,22 @@ void Slit::exposeEvent(XExposeEvent &ev) {
1053 frame.window.clearArea(ev.x, ev.y, ev.width, ev.height); 1055 frame.window.clearArea(ev.x, ev.y, ev.width, ev.height);
1054} 1056}
1055 1057
1056void Slit::updateForScreen(BScreen &screen) { 1058void Slit::screenSizeChanged(BScreen &screen) {
1057 reconfigure();
1058}
1059
1060void Slit::update(FbTk::Subject *subj) {
1061 reconfigure(); 1059 reconfigure();
1062#ifdef XINERAMA 1060#ifdef XINERAMA
1063 if (subj == &m_screen.resizeSig() && m_xineramaheadmenu) 1061 if (m_xineramaheadmenu)
1064 m_xineramaheadmenu->reloadHeads(); 1062 m_xineramaheadmenu->reloadHeads();
1065#endif // XINERAMA 1063#endif // XINERAMA
1066} 1064}
1067 1065
1066void Slit::updateForScreen(BScreen &screen) {
1067 reconfigure();
1068}
1069
1070void Slit::update(FbTk::Subject*) {
1071 updateForScreen(screen());
1072}
1073
1068void Slit::clearWindow() { 1074void Slit::clearWindow() {
1069 frame.window.clear(); 1075 frame.window.clear();
1070} 1076}
diff --git a/src/Slit.hh b/src/Slit.hh
index e1bcc5e..5514b42 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -133,6 +133,7 @@ public:
133 SlitClients &clients() { return m_client_list; } 133 SlitClients &clients() { return m_client_list; }
134private: 134private:
135 /// Called when screen has changed 135 /// Called when screen has changed
136 void screenSizeChanged(BScreen &screen);
136 void updateForScreen(BScreen &screen); 137 void updateForScreen(BScreen &screen);
137 138
138 void updateAlpha(); 139 void updateAlpha();
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 0292b87..f23e124 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -51,6 +51,7 @@
51#include "FbTk/IntMenuItem.hh" 51#include "FbTk/IntMenuItem.hh"
52#include "FbTk/Shape.hh" 52#include "FbTk/Shape.hh"
53#include "FbTk/SimpleObserver.hh" 53#include "FbTk/SimpleObserver.hh"
54#include "FbTk/MemFun.hh"
54 55
55// use GNU extensions 56// use GNU extensions
56#ifndef _GNU_SOURCE 57#ifndef _GNU_SOURCE
@@ -253,8 +254,10 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
253 m_observers.push_back(makeObserver(*this, &Toolbar::reconfigure)); 254 m_observers.push_back(makeObserver(*this, &Toolbar::reconfigure));
254 m_theme.reconfigSig().attach(m_observers.back()); 255 m_theme.reconfigSig().attach(m_observers.back());
255 screen().reconfigureSig().attach(m_observers.back()); // get this on antialias change 256 screen().reconfigureSig().attach(m_observers.back()); // get this on antialias change
257
256 // listen to screen size changes 258 // listen to screen size changes
257 screen().resizeSig().attach(m_observers.back()); 259 m_signal_tracker.join(screen().resizeSig(),
260 FbTk::MemFun(*this, &Toolbar::screenChanged));
258 261
259 262
260 moveToLayer((*m_rc_layernum).getNum()); 263 moveToLayer((*m_rc_layernum).getNum());
@@ -380,6 +383,10 @@ void Toolbar::lower() {
380 m_layeritem.lower(); 383 m_layeritem.lower();
381} 384}
382 385
386void Toolbar::screenChanged(BScreen &screen) {
387 reconfigure();
388}
389
383void Toolbar::reconfigure() { 390void Toolbar::reconfigure() {
384 391
385 updateVisibleState(); 392 updateVisibleState();
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index 100b38b..f631c41 100644
--- a/src/Toolbar.hh
+++ b/src/Toolbar.hh
@@ -41,6 +41,7 @@
41#include "FbTk/XLayerItem.hh" 41#include "FbTk/XLayerItem.hh"
42#include "FbTk/EventHandler.hh" 42#include "FbTk/EventHandler.hh"
43#include "FbTk/FbWindow.hh" 43#include "FbTk/FbWindow.hh"
44#include "FbTk/Signal.hh"
44 45
45#include <memory> 46#include <memory>
46 47
@@ -139,6 +140,9 @@ private:
139 void updateStrut(); 140 void updateStrut();
140 void updateAlpha(); 141 void updateAlpha();
141 142
143 /// Called when the screen changed property.
144 void screenChanged(BScreen &screen);
145
142 bool m_hidden; ///< hidden state 146 bool m_hidden; ///< hidden state
143 147
144 /// Toolbar frame 148 /// Toolbar frame
@@ -193,6 +197,7 @@ private:
193 bool m_resize_lock; ///< to lock rearrangeItems or not 197 bool m_resize_lock; ///< to lock rearrangeItems or not
194 /// observers for various signals 198 /// observers for various signals
195 std::vector<FbTk::Observer*> m_observers; 199 std::vector<FbTk::Observer*> m_observers;
200 FbTk::SignalTracker m_signal_tracker;
196}; 201};
197 202
198 203