aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2021-04-15 13:06:06 -0500
committerDevin J. Pohly <djpohly@gmail.com>2021-04-15 13:06:06 -0500
commit3f86336badecd7ced48db2a71ddcfb141fa5f39d (patch)
tree9d30b0dad5af09ad3ef6048e6e9dae8f18078d80 /dwl.c
parentb372d4b55e256b96fe926c512499ed90c460d66f (diff)
parent3727f4a7b3d230226f0082581444344d563e0f9c (diff)
Merge branch 'main' into pipe-status
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index f4b9b3a..d7e798b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -96,6 +96,7 @@ typedef struct {
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener destroy;
+ struct wl_listener set_title;
struct wl_listener fullscreen;
struct wlr_box geom; /* layout-relative, includes border */
Monitor *mon;
@@ -288,6 +289,7 @@ static void unmaplayersurface(LayerSurface *layersurface);
static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
static void unmapnotify(struct wl_listener *listener, void *data);
static void updatemons(struct wl_listener *listener, void *data);
+static void updatetitle(struct wl_listener *listener, void *data);
static void view(const Arg *arg);
static void virtualkeyboard(struct wl_listener *listener, void *data);
static Client *xytoclient(double x, double y);
@@ -891,6 +893,7 @@ createnotify(struct wl_listener *listener, void *data)
LISTEN(&xdg_surface->events.map, &c->map, mapnotify);
LISTEN(&xdg_surface->events.unmap, &c->unmap, unmapnotify);
LISTEN(&xdg_surface->events.destroy, &c->destroy, destroynotify);
+ LISTEN(&xdg_surface->toplevel->events.set_title, &c->set_title, updatetitle);
LISTEN(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen,
fullscreennotify);
c->isfullscreen = 0;
@@ -994,6 +997,7 @@ destroynotify(struct wl_listener *listener, void *data)
wl_list_remove(&c->map.link);
wl_list_remove(&c->unmap.link);
wl_list_remove(&c->destroy.link);
+ wl_list_remove(&c->set_title.link);
wl_list_remove(&c->fullscreen.link);
#ifdef XWAYLAND
if (c->type == X11Managed)
@@ -2299,6 +2303,14 @@ updatemons(struct wl_listener *listener, void *data)
}
void
+updatetitle(struct wl_listener *listener, void *data)
+{
+ Client *c = wl_container_of(listener, c, set_title);
+ if (c == focustop(c->mon))
+ printstatus();
+}
+
+void
view(const Arg *arg)
{
if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
@@ -2434,6 +2446,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
activatex11);
LISTEN(&xwayland_surface->events.request_configure, &c->configure,
configurex11);
+ 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,
fullscreennotify);