Add client_seturgent and a bit more ICCCM compatibility
Stolen straight from 3.4 Signed-off-by: Gregor Best <gbe@ring0.de> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
ec6f9fa825
commit
7bd501af67
18
client.c
18
client.c
|
@ -177,6 +177,22 @@ client_ban(Client *c)
|
||||||
XUnmapWindow(globalconf.display, c->titlebar.sw->window);
|
XUnmapWindow(globalconf.display, c->titlebar.sw->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
client_seturgent(Client *c, Bool set) {
|
||||||
|
XWMHints *wmh = XGetWMHints(globalconf.display, c->win);
|
||||||
|
if (!wmh)
|
||||||
|
return;
|
||||||
|
if (set)
|
||||||
|
wmh->flags |= XUrgencyHint;
|
||||||
|
else
|
||||||
|
wmh->flags &= ~(XUrgencyHint);
|
||||||
|
|
||||||
|
XSetWMHints(globalconf.display, c->win, wmh);
|
||||||
|
XFree(wmh);
|
||||||
|
c->isurgent = set;
|
||||||
|
client_updatewmhints(c);
|
||||||
|
}
|
||||||
|
|
||||||
/** Give focus to client, or to first client if c is NULL
|
/** Give focus to client, or to first client if c is NULL
|
||||||
* \param c client
|
* \param c client
|
||||||
* \param screen Screen ID
|
* \param screen Screen ID
|
||||||
|
@ -222,6 +238,8 @@ client_focus(Client *c, int screen, Bool raise)
|
||||||
* will appear under the mouse, grabbuttons */
|
* will appear under the mouse, grabbuttons */
|
||||||
window_grabbuttons(c->win, c->phys_screen);
|
window_grabbuttons(c->win, c->phys_screen);
|
||||||
phys_screen = c->phys_screen;
|
phys_screen = c->phys_screen;
|
||||||
|
/* ICCCM requires us to unset the urgent hint on focus */
|
||||||
|
client_seturgent(c, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
1
client.h
1
client.h
|
@ -40,6 +40,7 @@ void client_updatetitle(Client *);
|
||||||
void client_saveprops(Client *);
|
void client_saveprops(Client *);
|
||||||
void client_kill(Client *);
|
void client_kill(Client *);
|
||||||
void client_setfloating(Client *, Bool);
|
void client_setfloating(Client *, Bool);
|
||||||
|
void client_seturgent(Client *, Bool);
|
||||||
|
|
||||||
Uicb uicb_client_kill;
|
Uicb uicb_client_kill;
|
||||||
Uicb uicb_client_moveresize;
|
Uicb uicb_client_moveresize;
|
||||||
|
|
Loading…
Reference in New Issue