xF: make highlights request attention from the WM
This commit is contained in:
@@ -1158,6 +1158,29 @@ relay_process_response (const struct relay_event_data_response *e)
|
||||
|
||||
static void app_buffer_list_ensure_visible (const struct buffer *buffer);
|
||||
|
||||
// This could be moved to liberty-xui, but it's somewhat unique to our needs.
|
||||
static void
|
||||
xui_request_attention (void)
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
XEvent xev =
|
||||
{
|
||||
.xclient.type = ClientMessage,
|
||||
.xclient.window = g_xui.x11_window,
|
||||
.xclient.message_type =
|
||||
XInternAtom (g_xui.dpy, "_NET_WM_STATE", False),
|
||||
.xclient.format = 32,
|
||||
.xclient.data.l[0] = 1, // _NET_WM_STATE_ADD
|
||||
.xclient.data.l[1] =
|
||||
XInternAtom (g_xui.dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", False),
|
||||
.xclient.data.l[3] = 1, // Source indication: normal
|
||||
};
|
||||
XSendEvent (g_xui.dpy, DefaultRootWindow (g_xui.dpy), False,
|
||||
SubstructureRedirectMask | SubstructureNotifyMask, &xev);
|
||||
XFlush (g_xui.dpy);
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct buffer *
|
||||
buffer_find (const char *name)
|
||||
{
|
||||
@@ -1247,6 +1270,7 @@ relay_process_buffer_line (struct buffer *b,
|
||||
&& b->kind == RELAY_BUFFER_KIND_PRIVATE_MESSAGE))
|
||||
{
|
||||
g_xui.ui->beep ();
|
||||
xui_request_attention ();
|
||||
if (!visible)
|
||||
b->highlighted = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user