From 8fbeaf279e930b2d9c236cba29b923609b910f5c Mon Sep 17 00:00:00 2001 From: markt Date: Sat, 30 Jun 2007 01:28:54 +0000 Subject: little hack for fixing _NET_WM_STATE_DEMANDS_ATTENTION with tabs --- ChangeLog | 3 +++ src/Ewmh.cc | 21 ++++++++++++++------- src/Ewmh.hh | 2 ++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c1bcc4..83aeb15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0.0: +*07/06/30: + * Fix _NET_WM_STATE_DEMANDS_ATTENTION with tabbed windows, #1732392 (Mark) + Ewmh.cc/hh *07/06/29: * Updates for compiling with gcc 4.3 (thanks Dmitry E. Oboukhov) *07/06/28: diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 945c7b6..b4e831d 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -729,11 +729,11 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, // ce.data.l[1] = the first property to alter // ce.data.l[2] = second property to alter (can be zero) if (ce.data.l[0] == STATE_REMOVE) { - setState(win, ce.data.l[1], false); - setState(win, ce.data.l[2], false); + setState(win, ce.data.l[1], false, *winclient); + setState(win, ce.data.l[2], false, *winclient); } else if (ce.data.l[0] == STATE_ADD) { - setState(win, ce.data.l[1], true); - setState(win, ce.data.l[2], true); + setState(win, ce.data.l[1], true, *winclient); + setState(win, ce.data.l[2], true, *winclient); } else if (ce.data.l[0] == STATE_TOGGLE) { toggleState(win, ce.data.l[1]); toggleState(win, ce.data.l[2]); @@ -1031,8 +1031,15 @@ void Ewmh::createAtoms() { utf8_string = XInternAtom(disp, "UTF8_STRING", False); } -// set window state +// wrapper for avoiding changing every AtomHandler to include an unnecessary +// parameter, although we need it for _NET_WM_STATE_DEMANDS_ATTENTION void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { + setState(win, state, value, win.winClient()); +} + +// set window state +void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, + WinClient &client) { if (state == m_net_wm_state_sticky) { // STICKY if (value && !win.isStuck() || (!value && win.isStuck())) @@ -1072,10 +1079,10 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { win.moveToLayer(Layer::NORMAL); } else if (state == m_net_wm_state_demands_attention) { if (value) { // if add attention - Fluxbox::instance()->attentionHandler().addAttention(win.winClient()); + Fluxbox::instance()->attentionHandler().addAttention(client); } else { // erase it Fluxbox::instance()->attentionHandler(). - update(&win.winClient().focusSig()); + update(&client.focusSig()); } } diff --git a/src/Ewmh.hh b/src/Ewmh.hh index f917390..c1a6868 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh @@ -67,6 +67,8 @@ private: enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2}; void setState(FluxboxWindow &win, Atom state, bool value); + void setState(FluxboxWindow &win, Atom state, bool value, + WinClient &client); void toggleState(FluxboxWindow &win, Atom state); void createAtoms(); void updateStrut(WinClient &winclient); -- cgit v0.11.2