added support for urgency hint, thanks Mark Tiefenbruck

This commit is contained in:
fluxgen 2006-06-11 12:47:47 +00:00
parent 2fdc6ab808
commit 3aa4244ab8
4 changed files with 20 additions and 5 deletions

View file

@ -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

View file

@ -153,5 +153,4 @@ private:
void saveState(FluxboxWindow &win, WindowState *state);
FbTk::FbString getUTF8Property(Atom property);
AttentionNoticeHandler m_demands_attention;
};

View file

@ -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);
}
}

View file

@ -32,6 +32,7 @@
#include "FbTk/Timer.hh"
#include "FbTk/Observer.hh"
#include "FbTk/SignalHandler.hh"
#include "AttentionNoticeHandler.hh"
#include <X11/Xlib.h>
#include <X11/Xresource.h>
@ -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;
};