diff options
author | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-05-17 15:31:31 -0500 |
---|---|---|
committer | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-05-17 15:31:31 -0500 |
commit | 88a8b784d08ec2e8bdbfc50f1e9adb7f7fbcce9c (patch) | |
tree | cde18fd9e4a862295f08e2ae237f694ff2f34c75 /dwl.c | |
parent | 79a148224ffb5a55510de691f95eda2d32c6d2bf (diff) | |
parent | 8870ba0bb8106a4a367bd8dee78178891b8c19db (diff) |
Merge remote-tracking branch 'djpohly/main' into wlroots-next
chase wlroots X11 hints update
Diffstat (limited to 'dwl.c')
-rw-r--r-- | dwl.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -50,8 +50,9 @@ #include <wlr/util/log.h> #include <xkbcommon/xkbcommon.h> #ifdef XWAYLAND -#include <X11/Xlib.h> #include <wlr/xwayland.h> +#include <X11/Xlib.h> +#include <xcb/xcb_icccm.h> #endif #include "util.h" @@ -114,6 +115,7 @@ typedef struct { #ifdef XWAYLAND struct wl_listener activate; struct wl_listener configure; + struct wl_listener set_hints; #endif int bw; unsigned int tags; @@ -348,6 +350,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 sigchld(int unused); static void xwaylandready(struct wl_listener *listener, void *data); static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11}; @@ -925,6 +928,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 @@ -1000,7 +1004,7 @@ focusclient(Client *c, int lift) } else { Client *w; struct wlr_scene_node *node = old->data; - if ((w = node->data)) + if (old->role_data && (w = node->data)) for (i = 0; i < 4; i++) wlr_scene_rect_set_color(w->border[i], bordercolor); @@ -1296,6 +1300,7 @@ monocle(Monitor *m) continue; resize(c, m->w.x, m->w.y, m->w.width, m->w.height, 0); } + focusclient(focustop(m), 1); } void @@ -2342,6 +2347,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, @@ -2362,6 +2368,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 = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints); + printstatus(); + } +} + +void sigchld(int unused) { siginfo_t in; |