From fd0389d2e1c28e7dcd1507f76ed37eb8366c4af0 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 30 Aug 2008 15:24:14 -0400 Subject: more fun with global variables --- src/WinButton.cc | 6 +++++- src/WinButton.hh | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/WinButton.cc b/src/WinButton.cc index e8cf0bd..d64034e 100644 --- a/src/WinButton.cc +++ b/src/WinButton.cc @@ -21,6 +21,7 @@ #include "WinButton.hh" #include "Window.hh" +#include "WindowCmd.hh" #include "Screen.hh" #include "WinClient.hh" #include "WinButtonTheme.hh" @@ -32,7 +33,7 @@ #endif // SHAPE -WinButton::WinButton(const FluxboxWindow &listen_to, +WinButton::WinButton(FluxboxWindow &listen_to, FbTk::ThemeProxy &theme, FbTk::ThemeProxy &pressed, Type buttontype, const FbTk::FbWindow &parent, @@ -55,7 +56,10 @@ void WinButton::exposeEvent(XExposeEvent &event) { } void WinButton::buttonReleaseEvent(XButtonEvent &event) { + WinClient *old = WindowCmd::client(); + WindowCmd::setWindow(&m_listen_to); FbTk::Button::buttonReleaseEvent(event); + WindowCmd::setClient(old); } // when someone else tries to set the background, we may override it diff --git a/src/WinButton.hh b/src/WinButton.hh index db2fdf9..7f40f1a 100644 --- a/src/WinButton.hh +++ b/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 &theme, FbTk::ThemeProxy &pressed, Type buttontype, const FbTk::FbWindow &parent, int x, int y, @@ -60,7 +60,7 @@ public: private: void drawType(); Type m_type; ///< the button type - const FluxboxWindow &m_listen_to; + FluxboxWindow &m_listen_to; FbTk::ThemeProxy &m_theme, &m_pressed_theme; FbTk::FbPixmap m_icon_pixmap; -- cgit v0.11.2