diff options
-rw-r--r-- | src/AttentionNoticeHandler.cc | 4 | ||||
-rw-r--r-- | src/Ewmh.cc | 21 | ||||
-rw-r--r-- | src/Ewmh.hh | 2 |
3 files changed, 20 insertions, 7 deletions
diff --git a/src/AttentionNoticeHandler.cc b/src/AttentionNoticeHandler.cc index c2599c9..fec3933 100644 --- a/src/AttentionNoticeHandler.cc +++ b/src/AttentionNoticeHandler.cc | |||
@@ -98,6 +98,10 @@ void AttentionNoticeHandler::addAttention(Focusable &client) { | |||
98 | 98 | ||
99 | void AttentionNoticeHandler::update(FbTk::Subject *subj) { | 99 | void AttentionNoticeHandler::update(FbTk::Subject *subj) { |
100 | 100 | ||
101 | // we need to be able to get the window | ||
102 | if (typeid(*subj) != typeid(Focusable::FocusSubject)) | ||
103 | return; | ||
104 | |||
101 | // all signals results in destruction of the notice | 105 | // all signals results in destruction of the notice |
102 | 106 | ||
103 | Focusable::FocusSubject *winsubj = | 107 | Focusable::FocusSubject *winsubj = |
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 | ||
diff --git a/src/Ewmh.hh b/src/Ewmh.hh index 3df66d3..8d5d986 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh | |||
@@ -66,6 +66,8 @@ private: | |||
66 | enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2}; | 66 | enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2}; |
67 | 67 | ||
68 | void setState(FluxboxWindow &win, Atom state, bool value); | 68 | void setState(FluxboxWindow &win, Atom state, bool value); |
69 | void setState(FluxboxWindow &win, Atom state, bool value, | ||
70 | WinClient &client); | ||
69 | void toggleState(FluxboxWindow &win, Atom state); | 71 | void toggleState(FluxboxWindow &win, Atom state); |
70 | void createAtoms(); | 72 | void createAtoms(); |
71 | void updateStrut(WinClient &winclient); | 73 | void updateStrut(WinClient &winclient); |