From 3aa4244ab8c6a4cbdd247ddcc3477cb8c38f64c0 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 11 Jun 2006 12:47:47 +0000 Subject: added support for urgency hint, thanks Mark Tiefenbruck --- src/Ewmh.cc | 10 ++++++---- src/Ewmh.hh | 1 - src/WinClient.cc | 9 +++++++++ src/fluxbox.hh | 5 +++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index cf1cbbe..e034aa9 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -1057,10 +1057,12 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { else win.moveToLayer(Layer::NORMAL); } else if (state == m_net_wm_state_demands_attention) { - if (value) // if add attention - m_demands_attention.addAttention(win); - else // erase it - m_demands_attention.update(&win.attentionSig()); + if (value) { // if add attention + Fluxbox::instance()->attentionHandler().addAttention(win); + } else { // erase it + Fluxbox::instance()->attentionHandler(). + update(&win.attentionSig()); + } } // Note: state == net_wm_state_modal, We should not change it diff --git a/src/Ewmh.hh b/src/Ewmh.hh index 4882ed5..6044f7c 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh @@ -153,5 +153,4 @@ private: void saveState(FluxboxWindow &win, WindowState *state); FbTk::FbString getUTF8Property(Atom property); - AttentionNoticeHandler m_demands_attention; }; diff --git a/src/WinClient.cc b/src/WinClient.cc index 82027da..acb8250 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -514,6 +514,15 @@ void WinClient::updateWMHints() { else m_icon_mask = 0; + if (m_win && m_win->isInitialized()) { + if (wmhint->flags & XUrgencyHint) { + Fluxbox::instance()->attentionHandler().addAttention(*m_win); + } else { + Fluxbox::instance()->attentionHandler(). + update(&(m_win->attentionSig())); + } + } + XFree(wmhint); } } diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 7506dc6..c3936c7 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -32,6 +32,7 @@ #include "FbTk/Timer.hh" #include "FbTk/Observer.hh" #include "FbTk/SignalHandler.hh" +#include "AttentionNoticeHandler.hh" #include #include @@ -207,6 +208,8 @@ public: // screen we are watching for modifier changes BScreen *watchingScreen() { return m_watching_screen; } const XEvent &lastEvent() const { return m_last_event; } + + AttentionNoticeHandler &attentionHandler() { return m_attention_handler; } private: @@ -314,6 +317,8 @@ private: const char *m_RC_PATH; const char *m_RC_INIT_FILE; Atom m_kwm1_dockwindow, m_kwm2_dockwindow; + + AttentionNoticeHandler m_attention_handler; }; -- cgit v0.11.2