xF: make highlights request attention from the WM
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success

This commit is contained in:
2026-08-07 12:01:48 +02:00
parent 2d8867f6fa
commit 7538dfad2d
+24
View File
@@ -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;
}