more fun with global variables
Mark Tiefenbruck mark@fluxbox.org
2 files changed,
7 insertions(+),
3 deletions(-)
M
src/WinButton.cc
→
src/WinButton.cc
@@ -21,6 +21,7 @@ // DEALINGS IN THE SOFTWARE.
#include "WinButton.hh" #include "Window.hh" +#include "WindowCmd.hh" #include "Screen.hh" #include "WinClient.hh" #include "WinButtonTheme.hh"@@ -32,7 +33,7 @@ #include <X11/extensions/shape.h>
#endif // SHAPE -WinButton::WinButton(const FluxboxWindow &listen_to, +WinButton::WinButton(FluxboxWindow &listen_to, FbTk::ThemeProxy<WinButtonTheme> &theme, FbTk::ThemeProxy<WinButtonTheme> &pressed, Type buttontype, const FbTk::FbWindow &parent,@@ -55,7 +56,10 @@ drawType();
} void WinButton::buttonReleaseEvent(XButtonEvent &event) { + WinClient *old = WindowCmd<void>::client(); + WindowCmd<void>::setWindow(&m_listen_to); FbTk::Button::buttonReleaseEvent(event); + WindowCmd<void>::setClient(old); } // when someone else tries to set the background, we may override it
M
src/WinButton.hh
→
src/WinButton.hh
@@ -39,7 +39,7 @@ class WinButton:public FbTk::Button, public FbTk::Observer {
public: /// draw type for the button enum Type {MAXIMIZE, MINIMIZE, SHADE, STICK, CLOSE, MENUICON}; - WinButton(const FluxboxWindow &listen_to, + WinButton(FluxboxWindow &listen_to, FbTk::ThemeProxy<WinButtonTheme> &theme, FbTk::ThemeProxy<WinButtonTheme> &pressed, Type buttontype, const FbTk::FbWindow &parent, int x, int y,@@ -60,7 +60,7 @@ void update(FbTk::Subject *subj);
private: void drawType(); Type m_type; ///< the button type - const FluxboxWindow &m_listen_to; + FluxboxWindow &m_listen_to; FbTk::ThemeProxy<WinButtonTheme> &m_theme, &m_pressed_theme; FbTk::FbPixmap m_icon_pixmap;