Add support for _NET_WM_STATE_DEMANDS_ATTENTION.

_NET_WM_STATE_DEMANDS_ATTENTION indicates that some action in or with
the window happened. It's a weaker hint than urgency flag of WM_HINTS,
but some applications and almost all Qt applications use it instead of
WM_HINTS' urgency flag (one example is Skype).
This commit is contained in:
oblique
2013-02-26 02:37:35 +02:00
committed by Michael Stapelberg
parent 8327f837a0
commit 8a4a719093
7 changed files with 230 additions and 176 deletions

View File

@ -1530,6 +1530,45 @@ void con_update_parents_urgency(Con *con) {
}
}
/*
* Set urgency flag to the container, all the parent containers and the workspace.
*
*/
void con_set_urgency(Con *con, bool urgent) {
if (focused == con) {
DLOG("Ignoring urgency flag for current client\n");
con->window->urgent.tv_sec = 0;
con->window->urgent.tv_usec = 0;
return;
}
if (con->urgency_timer == NULL) {
con->urgent = urgent;
} else
DLOG("Discarding urgency WM_HINT because timer is running\n");
//CLIENT_LOG(con);
if (con->window) {
if (con->urgent) {
gettimeofday(&con->window->urgent, NULL);
} else {
con->window->urgent.tv_sec = 0;
con->window->urgent.tv_usec = 0;
}
}
con_update_parents_urgency(con);
if (con->urgent == urgent)
LOG("Urgency flag changed to %d\n", con->urgent);
Con *ws;
/* Set the urgency flag on the workspace, if a workspace could be found
* (for dock clients, that is not the case). */
if ((ws = con_get_workspace(con)) != NULL)
workspace_update_urgent_flag(ws);
}
/*
* Create a string representing the subtree under con.
*