all repos — fluxbox @ 9751d05db3a45f0d3d22a02002374562fb9d44a7

custom fork of the fluxbox windowmanager

fixed so it gets win state sticky to update sticky button
fluxgen fluxgen
commit

9751d05db3a45f0d3d22a02002374562fb9d44a7

parent

7815e2b30ec64e4b33f8aeca44e264f674a9043e

1 files changed, 35 insertions(+), 32 deletions(-)

jump to
M src/WinButton.ccsrc/WinButton.cc

@@ -19,16 +19,18 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -/// $Id: WinButton.cc,v 1.2 2003/02/23 01:06:23 fluxgen Exp $ +/// $Id: WinButton.cc,v 1.3 2003/04/25 17:35:28 fluxgen Exp $ #include "WinButton.hh" #include "App.hh" +#include "Window.hh" -WinButton::WinButton(Type buttontype, const FbTk::FbWindow &parent, +WinButton::WinButton(const FluxboxWindow &listen_to, + Type buttontype, const FbTk::FbWindow &parent, int x, int y, unsigned int width, unsigned int height): FbTk::Button(parent, x, y, width, height), - m_type(buttontype) { + m_type(buttontype), m_listen_to(listen_to) { }

@@ -37,48 +39,45 @@ FbTk::Button::exposeEvent(event);

drawType(); } +void WinButton::buttonReleaseEvent(XButtonEvent &event) { + FbTk::Button::buttonReleaseEvent(event); + clear(); +} + void WinButton::drawType() { if (gc() == 0) // must have valid graphic context return; - Display *disp = FbTk::App::instance()->display(); switch (m_type) { case MAXIMIZE: - XDrawRectangle(disp, window().window(), - gc(), - 2, 2, width() - 5, height() - 5); - XDrawLine(disp, window().window(), - gc(), - 2, 3, width() - 3, 3); + window().drawRectangle(gc(), + 2, 2, width() - 5, height() - 5); + window().drawLine(gc(), + 2, 3, width() - 3, 3); break; case MINIMIZE: - XDrawRectangle(disp, window().window(), - gc(), - 2, height() - 5, width() - 5, 2); + window().drawRectangle(gc(), + 2, height() - 5, width() - 5, 2); break; case STICK: - /* if (m_stuck) { - XFillRectangle(disp, window().window(), - gc(), - width()/2 - width()/4, height()/2 - height()/4, - width()/2, height()/2); - } else { */ - XFillRectangle(disp, window().window(), - gc(), - width()/2, height()/2, - width()/5, height()/5); - // } + if (m_listen_to.isStuck()) { + window().fillRectangle(gc(), + width()/2 - width()/4, height()/2 - height()/4, + width()/2, height()/2); + } else { + window().fillRectangle(gc(), + width()/2, height()/2, + width()/5, height()/5); + } break; case CLOSE: - XDrawLine(disp, window().window(), - gc(), - 2, 2, - width() - 3, height() - 3); - XDrawLine(disp, window().window(), - gc(), - 2, width() - 3, - height() - 3, 2); + window().drawLine(gc(), + 2, 2, + width() - 3, height() - 3); + window().drawLine(gc(), + 2, width() - 3, + height() - 3, 2); break; case SHADE: break;

@@ -89,3 +88,7 @@ void WinButton::clear() {

FbTk::Button::clear(); drawType(); } + +void WinButton::update(FbTk::Subject *subj) { + clear(); +}