diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 3 | ||||
-rw-r--r-- | src/Screen.hh | 20 | ||||
-rw-r--r-- | src/Slit.cc | 11 | ||||
-rw-r--r-- | src/Slit.hh | 8 | ||||
-rw-r--r-- | src/SystemTray.cc | 6 | ||||
-rw-r--r-- | src/SystemTray.hh | 9 |
6 files changed, 40 insertions, 17 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 7c372bc..8809609 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -345,7 +345,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
345 | m_focusedwindow_sig(*this), // focused window signal | 345 | m_focusedwindow_sig(*this), // focused window signal |
346 | m_reconfigure_sig(*this), // reconfigure signal | 346 | m_reconfigure_sig(*this), // reconfigure signal |
347 | m_resize_sig(*this), | 347 | m_resize_sig(*this), |
348 | m_bg_change_sig(*this), | ||
349 | m_layermanager(num_layers), | 348 | m_layermanager(num_layers), |
350 | m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")), | 349 | m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")), |
351 | m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")), | 350 | m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")), |
@@ -855,7 +854,7 @@ void BScreen::propertyNotify(Atom atom) { | |||
855 | } | 854 | } |
856 | // TODO: this doesn't belong in FbPixmap | 855 | // TODO: this doesn't belong in FbPixmap |
857 | } else if (FbTk::FbPixmap::rootwinPropertyNotify(screenNumber(), atom)) | 856 | } else if (FbTk::FbPixmap::rootwinPropertyNotify(screenNumber(), atom)) |
858 | m_bg_change_sig.notify(); | 857 | m_bg_change_sig.emit(*this); |
859 | } | 858 | } |
860 | 859 | ||
861 | void BScreen::keyPressEvent(XKeyEvent &ke) { | 860 | void BScreen::keyPressEvent(XKeyEvent &ke) { |
diff --git a/src/Screen.hh b/src/Screen.hh index 7bafead..00ab2e5 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -209,24 +209,25 @@ public: | |||
209 | @name Screen signals | 209 | @name Screen signals |
210 | */ | 210 | */ |
211 | //@{ | 211 | //@{ |
212 | typedef FbTk::Signal<void, BScreen&> ScreenSignal; | ||
212 | /// client list signal | 213 | /// client list signal |
213 | FbTk::Subject &clientListSig() { return m_clientlist_sig; } | 214 | FbTk::Subject &clientListSig() { return m_clientlist_sig; } |
214 | /// icon list sig | 215 | /// icon list sig |
215 | FbTk::Subject &iconListSig() { return m_iconlist_sig; } | 216 | FbTk::Subject &iconListSig() { return m_iconlist_sig; } |
216 | /// workspace count signal | 217 | /// workspace count signal |
217 | FbTk::Signal<void, BScreen&> &workspaceCountSig() { return m_workspacecount_sig; } | 218 | ScreenSignal &workspaceCountSig() { return m_workspacecount_sig; } |
218 | /// workspace names signal | 219 | /// workspace names signal |
219 | FbTk::Signal<void, BScreen&> &workspaceNamesSig() { return m_workspacenames_sig; } | 220 | ScreenSignal &workspaceNamesSig() { return m_workspacenames_sig; } |
220 | /// workspace area signal | 221 | /// workspace area signal |
221 | FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; } | 222 | FbTk::Subject &workspaceAreaSig() { return m_workspace_area_sig; } |
222 | /// current workspace signal | 223 | /// current workspace signal |
223 | FbTk::Signal<void, BScreen&> ¤tWorkspaceSig() { return m_currentworkspace_sig; } | 224 | ScreenSignal ¤tWorkspaceSig() { return m_currentworkspace_sig; } |
224 | /// focused window signal | 225 | /// focused window signal |
225 | FbTk::Subject &focusedWindowSig() { return m_focusedwindow_sig; } | 226 | FbTk::Subject &focusedWindowSig() { return m_focusedwindow_sig; } |
226 | /// reconfigure signal | 227 | /// reconfigure signal |
227 | FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } | 228 | FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } |
228 | FbTk::Subject &resizeSig() { return m_resize_sig; } | 229 | FbTk::Subject &resizeSig() { return m_resize_sig; } |
229 | FbTk::Subject &bgChangeSig() { return m_bg_change_sig; } | 230 | ScreenSignal &bgChangeSig() { return m_bg_change_sig; } |
230 | //@} | 231 | //@} |
231 | 232 | ||
232 | /// called when the screen receives a signal from a subject | 233 | /// called when the screen receives a signal from a subject |
@@ -494,16 +495,15 @@ private: | |||
494 | ScreenSubject | 495 | ScreenSubject |
495 | m_clientlist_sig, ///< client signal | 496 | m_clientlist_sig, ///< client signal |
496 | m_iconlist_sig, ///< notify if a window gets iconified/deiconified | 497 | m_iconlist_sig, ///< notify if a window gets iconified/deiconified |
497 | |||
498 | m_workspace_area_sig, ///< workspace area changed signal | 498 | m_workspace_area_sig, ///< workspace area changed signal |
499 | m_focusedwindow_sig, ///< focused window signal | 499 | m_focusedwindow_sig, ///< focused window signal |
500 | m_reconfigure_sig, ///< reconfigure signal | 500 | m_reconfigure_sig, ///< reconfigure signal |
501 | m_resize_sig, ///< resize signal | 501 | m_resize_sig; ///< resize signal |
502 | m_bg_change_sig; ///< background change signal | ||
503 | 502 | ||
504 | FbTk::Signal<void, BScreen&> m_workspacecount_sig; ///< workspace count signal | 503 | ScreenSignal m_bg_change_sig; ///< background change signal |
505 | FbTk::Signal<void, BScreen&> m_currentworkspace_sig; ///< current workspace signal | 504 | ScreenSignal m_workspacecount_sig; ///< workspace count signal |
506 | FbTk::Signal<void, BScreen&> m_workspacenames_sig; ///< workspace names signal | 505 | ScreenSignal m_currentworkspace_sig; ///< current workspace signal |
506 | ScreenSignal m_workspacenames_sig; ///< workspace names signal | ||
507 | 507 | ||
508 | FbTk::MultLayers m_layermanager; | 508 | FbTk::MultLayers m_layermanager; |
509 | 509 | ||
diff --git a/src/Slit.cc b/src/Slit.cc index 56e591e..6824bde 100644 --- a/src/Slit.cc +++ b/src/Slit.cc | |||
@@ -41,6 +41,8 @@ | |||
41 | #include "FbTk/Theme.hh" | 41 | #include "FbTk/Theme.hh" |
42 | #include "FbTk/Transparent.hh" | 42 | #include "FbTk/Transparent.hh" |
43 | #include "FbTk/MacroCommand.hh" | 43 | #include "FbTk/MacroCommand.hh" |
44 | #include "FbTk/MemFun.hh" | ||
45 | |||
44 | #include "FbCommands.hh" | 46 | #include "FbCommands.hh" |
45 | #include "Layer.hh" | 47 | #include "Layer.hh" |
46 | #include "LayerMenu.hh" | 48 | #include "LayerMenu.hh" |
@@ -264,7 +266,10 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) | |||
264 | // attach to theme and root window change signal | 266 | // attach to theme and root window change signal |
265 | theme().reconfigSig().attach(this); | 267 | theme().reconfigSig().attach(this); |
266 | scr.resizeSig().attach(this); | 268 | scr.resizeSig().attach(this); |
267 | scr.bgChangeSig().attach(this); | 269 | |
270 | join(scr.bgChangeSig(), | ||
271 | FbTk::MemFun(*this, &Slit::updateForScreen)); | ||
272 | |||
268 | scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) | 273 | scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) |
269 | 274 | ||
270 | scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu); | 275 | scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu); |
@@ -1048,6 +1053,10 @@ void Slit::exposeEvent(XExposeEvent &ev) { | |||
1048 | frame.window.clearArea(ev.x, ev.y, ev.width, ev.height); | 1053 | frame.window.clearArea(ev.x, ev.y, ev.width, ev.height); |
1049 | } | 1054 | } |
1050 | 1055 | ||
1056 | void Slit::updateForScreen(BScreen &screen) { | ||
1057 | reconfigure(); | ||
1058 | } | ||
1059 | |||
1051 | void Slit::update(FbTk::Subject *subj) { | 1060 | void Slit::update(FbTk::Subject *subj) { |
1052 | reconfigure(); | 1061 | reconfigure(); |
1053 | #ifdef XINERAMA | 1062 | #ifdef XINERAMA |
diff --git a/src/Slit.hh b/src/Slit.hh index 19e4698..e1bcc5e 100644 --- a/src/Slit.hh +++ b/src/Slit.hh | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "FbTk/Timer.hh" | 38 | #include "FbTk/Timer.hh" |
39 | #include "FbTk/Resource.hh" | 39 | #include "FbTk/Resource.hh" |
40 | #include "FbTk/XLayerItem.hh" | 40 | #include "FbTk/XLayerItem.hh" |
41 | #include "FbTk/Signal.hh" | ||
41 | 42 | ||
42 | #include <X11/Xutil.h> | 43 | #include <X11/Xutil.h> |
43 | 44 | ||
@@ -51,7 +52,9 @@ class Strut; | |||
51 | class Layer; | 52 | class Layer; |
52 | 53 | ||
53 | /// Handles dock apps | 54 | /// Handles dock apps |
54 | class Slit: public FbTk::EventHandler, public FbTk::Observer, public LayerObject { | 55 | class Slit: public FbTk::EventHandler, public FbTk::Observer, |
56 | public LayerObject, private FbTk::SignalTracker | ||
57 | { | ||
55 | public: | 58 | public: |
56 | typedef std::list<SlitClient *> SlitClients; | 59 | typedef std::list<SlitClient *> SlitClients; |
57 | /** | 60 | /** |
@@ -129,6 +132,9 @@ public: | |||
129 | const SlitClients &clients() const { return m_client_list; } | 132 | const SlitClients &clients() const { return m_client_list; } |
130 | SlitClients &clients() { return m_client_list; } | 133 | SlitClients &clients() { return m_client_list; } |
131 | private: | 134 | private: |
135 | /// Called when screen has changed | ||
136 | void updateForScreen(BScreen &screen); | ||
137 | |||
132 | void updateAlpha(); | 138 | void updateAlpha(); |
133 | void clearWindow(); | 139 | void clearWindow(); |
134 | void setupMenu(); | 140 | void setupMenu(); |
diff --git a/src/SystemTray.cc b/src/SystemTray.cc index 699ca47..0c3e550 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "FbTk/EventManager.hh" | 24 | #include "FbTk/EventManager.hh" |
25 | #include "FbTk/ImageControl.hh" | 25 | #include "FbTk/ImageControl.hh" |
26 | #include "FbTk/TextUtils.hh" | 26 | #include "FbTk/TextUtils.hh" |
27 | #include "FbTk/MemFun.hh" | ||
27 | 28 | ||
28 | #include "AtomHandler.hh" | 29 | #include "AtomHandler.hh" |
29 | #include "fluxbox.hh" | 30 | #include "fluxbox.hh" |
@@ -170,7 +171,10 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, | |||
170 | // setup signals | 171 | // setup signals |
171 | m_observer.reset(makeObserver(*this, &SystemTray::update)); | 172 | m_observer.reset(makeObserver(*this, &SystemTray::update)); |
172 | m_theme->reconfigSig().attach(m_observer.get()); | 173 | m_theme->reconfigSig().attach(m_observer.get()); |
173 | screen.bgChangeSig().attach(m_observer.get()); | 174 | |
175 | join(screen.bgChangeSig(), | ||
176 | FbTk::MemFun(*this, &SystemTray::updateForScreen)); | ||
177 | |||
174 | 178 | ||
175 | Fluxbox* fluxbox = Fluxbox::instance(); | 179 | Fluxbox* fluxbox = Fluxbox::instance(); |
176 | Display *disp = fluxbox->display(); | 180 | Display *disp = fluxbox->display(); |
diff --git a/src/SystemTray.hh b/src/SystemTray.hh index 132069a..c67e08a 100644 --- a/src/SystemTray.hh +++ b/src/SystemTray.hh | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include "FbTk/FbWindow.hh" | 26 | #include "FbTk/FbWindow.hh" |
27 | #include "FbTk/EventHandler.hh" | 27 | #include "FbTk/EventHandler.hh" |
28 | #include "FbTk/Signal.hh" | ||
28 | 29 | ||
29 | #include "ToolTheme.hh" | 30 | #include "ToolTheme.hh" |
30 | #include "ToolbarItem.hh" | 31 | #include "ToolbarItem.hh" |
@@ -42,7 +43,8 @@ template <class T> class ThemeProxy; | |||
42 | class Observer; | 43 | class Observer; |
43 | } | 44 | } |
44 | 45 | ||
45 | class SystemTray: public ToolbarItem, public FbTk::EventHandler { | 46 | class SystemTray: public ToolbarItem, public FbTk::EventHandler, |
47 | private FbTk::SignalTracker { | ||
46 | public: | 48 | public: |
47 | 49 | ||
48 | explicit SystemTray(const FbTk::FbWindow &parent, | 50 | explicit SystemTray(const FbTk::FbWindow &parent, |
@@ -85,7 +87,10 @@ public: | |||
85 | static Atom getXEmbedInfoAtom(); | 87 | static Atom getXEmbedInfoAtom(); |
86 | 88 | ||
87 | private: | 89 | private: |
88 | 90 | /// Called when an update for a screen is needed. | |
91 | void updateForScreen(BScreen &screen) { | ||
92 | update(); | ||
93 | } | ||
89 | void update(); | 94 | void update(); |
90 | 95 | ||
91 | typedef std::list<TrayWindow *> ClientList; | 96 | typedef std::list<TrayWindow *> ClientList; |