diff options
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r-- | src/Ewmh.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index f8d3598..99a8759 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -722,11 +722,11 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, | |||
722 | // ce.data.l[1] = the first property to alter | 722 | // ce.data.l[1] = the first property to alter |
723 | // ce.data.l[2] = second property to alter (can be zero) | 723 | // ce.data.l[2] = second property to alter (can be zero) |
724 | if (ce.data.l[0] == STATE_REMOVE) { | 724 | if (ce.data.l[0] == STATE_REMOVE) { |
725 | setState(win, ce.data.l[1], false); | 725 | setState(win, ce.data.l[1], false, *winclient); |
726 | setState(win, ce.data.l[2], false); | 726 | setState(win, ce.data.l[2], false, *winclient); |
727 | } else if (ce.data.l[0] == STATE_ADD) { | 727 | } else if (ce.data.l[0] == STATE_ADD) { |
728 | setState(win, ce.data.l[1], true); | 728 | setState(win, ce.data.l[1], true, *winclient); |
729 | setState(win, ce.data.l[2], true); | 729 | setState(win, ce.data.l[2], true, *winclient); |
730 | } else if (ce.data.l[0] == STATE_TOGGLE) { | 730 | } else if (ce.data.l[0] == STATE_TOGGLE) { |
731 | toggleState(win, ce.data.l[1]); | 731 | toggleState(win, ce.data.l[1]); |
732 | toggleState(win, ce.data.l[2]); | 732 | toggleState(win, ce.data.l[2]); |
@@ -1004,8 +1004,15 @@ void Ewmh::createAtoms() { | |||
1004 | utf8_string = XInternAtom(disp, "UTF8_STRING", False); | 1004 | utf8_string = XInternAtom(disp, "UTF8_STRING", False); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | // set window state | 1007 | // wrapper for avoiding changing every AtomHandler to include an unnecessary |
1008 | // parameter, although we need it for _NET_WM_STATE_DEMANDS_ATTENTION | ||
1008 | void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { | 1009 | void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { |
1010 | setState(win, state, value, win.winClient()); | ||
1011 | } | ||
1012 | |||
1013 | // set window state | ||
1014 | void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, | ||
1015 | WinClient &client) { | ||
1009 | if (state == m_net_wm_state_sticky) { // STICKY | 1016 | if (state == m_net_wm_state_sticky) { // STICKY |
1010 | if (value && !win.isStuck() || | 1017 | if (value && !win.isStuck() || |
1011 | (!value && win.isStuck())) | 1018 | (!value && win.isStuck())) |
@@ -1045,10 +1052,10 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { | |||
1045 | win.moveToLayer(Layer::NORMAL); | 1052 | win.moveToLayer(Layer::NORMAL); |
1046 | } else if (state == m_net_wm_state_demands_attention) { | 1053 | } else if (state == m_net_wm_state_demands_attention) { |
1047 | if (value) { // if add attention | 1054 | if (value) { // if add attention |
1048 | Fluxbox::instance()->attentionHandler().addAttention(win.winClient()); | 1055 | Fluxbox::instance()->attentionHandler().addAttention(client); |
1049 | } else { // erase it | 1056 | } else { // erase it |
1050 | Fluxbox::instance()->attentionHandler(). | 1057 | Fluxbox::instance()->attentionHandler(). |
1051 | update(&win.winClient().focusSig()); | 1058 | update(&client.focusSig()); |
1052 | } | 1059 | } |
1053 | } | 1060 | } |
1054 | 1061 | ||