aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-17 14:38:18 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-17 14:38:18 -0500
commit8870ba0bb8106a4a367bd8dee78178891b8c19db (patch)
treeca6046ea9f6e67c3eb8533b59e195288f2e8ca2c /dwl.c
parent5de68ba71362553e31a36f6a5a594e0ee830e611 (diff)
implement urgency hints for xwayland clients
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index abff38a..90a2789 100644
--- a/dwl.c
+++ b/dwl.c
@@ -112,6 +112,7 @@ typedef struct {
#ifdef XWAYLAND
struct wl_listener activate;
struct wl_listener configure;
+ struct wl_listener set_hints;
#endif
int bw;
unsigned int tags;
@@ -358,6 +359,7 @@ static void activatex11(struct wl_listener *listener, void *data);
static void configurex11(struct wl_listener *listener, void *data);
static void createnotifyx11(struct wl_listener *listener, void *data);
static Atom getatom(xcb_connection_t *xc, const char *name);
+static void sethints(struct wl_listener *listener, void *data);
static void xwaylandready(struct wl_listener *listener, void *data);
static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11};
static struct wl_listener xwayland_ready = {.notify = xwaylandready};
@@ -1046,6 +1048,7 @@ destroynotify(struct wl_listener *listener, void *data)
#ifdef XWAYLAND
if (c->type != XDGShell) {
wl_list_remove(&c->configure.link);
+ wl_list_remove(&c->set_hints.link);
wl_list_remove(&c->activate.link);
} else
#endif
@@ -2460,6 +2463,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
LISTEN(&xwayland_surface->events.request_activate, &c->activate, activatex11);
LISTEN(&xwayland_surface->events.request_configure, &c->configure,
configurex11);
+ LISTEN(&xwayland_surface->events.set_hints, &c->set_hints, sethints);
LISTEN(&xwayland_surface->events.set_title, &c->set_title, updatetitle);
LISTEN(&xwayland_surface->events.destroy, &c->destroy, destroynotify);
LISTEN(&xwayland_surface->events.request_fullscreen, &c->fullscreen,
@@ -2480,6 +2484,16 @@ getatom(xcb_connection_t *xc, const char *name)
}
void
+sethints(struct wl_listener *listener, void *data)
+{
+ Client *c = wl_container_of(listener, c, set_hints);
+ if (c != selclient()) {
+ c->isurgent = c->surface.xwayland->hints_urgency;
+ printstatus();
+ }
+}
+
+void
xwaylandready(struct wl_listener *listener, void *data)
{
struct wlr_xcursor *xcursor;