summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@proton.me>2023-10-09 22:37:36 -0600
committerLeonardo Hernández Hernández <leohdz172@proton.me>2023-10-09 22:37:36 -0600
commit8781f4dbf5bb4507239d29cd9ae8bb5c3fa0b2c5 (patch)
tree4de2faa22963ec5d163f032ff330d8481d4f9834
parentb299e01e44d0277a254ba55a030a6d205133c50b (diff)
parentdf131cdb78c6e3e79c3fafa522f0e4f6b43d2ab4 (diff)
Merge remote-tracking branch 'upstream/main' into wlroots-next
-rw-r--r--dwl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/dwl.c b/dwl.c
index 2f46507..6bc0bb7 100644
--- a/dwl.c
+++ b/dwl.c
@@ -56,7 +56,7 @@
#include <xkbcommon/xkbcommon.h>
#ifdef XWAYLAND
#include <wlr/xwayland.h>
-#include <X11/Xlib.h>
+#include <xcb/xcb.h>
#include <xcb/xcb_icccm.h>
#endif
@@ -382,11 +382,11 @@ static void associatex11(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 void dissociatex11(struct wl_listener *listener, void *data);
-static Atom getatom(xcb_connection_t *xc, const char *name);
+static xcb_atom_t 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 wlr_xwayland *xwayland;
-static Atom netatom[NetLast];
+static xcb_atom_t netatom[NetLast];
#endif
/* configuration, allows nested code to access above variables */
@@ -2790,10 +2790,10 @@ dissociatex11(struct wl_listener *listener, void *data)
wl_list_remove(&c->unmap.link);
}
-Atom
+xcb_atom_t
getatom(xcb_connection_t *xc, const char *name)
{
- Atom atom = 0;
+ xcb_atom_t atom = 0;
xcb_intern_atom_reply_t *reply;
xcb_intern_atom_cookie_t cookie = xcb_intern_atom(xc, 0, strlen(name), name);
if ((reply = xcb_intern_atom_reply(xc, cookie, NULL)))
@@ -2807,11 +2807,15 @@ void
sethints(struct wl_listener *listener, void *data)
{
Client *c = wl_container_of(listener, c, set_hints);
+ struct wlr_surface *surface = client_surface(c);
if (c == focustop(selmon))
return;
- client_set_border_color(c, urgentcolor);
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
+
+ if (c->isurgent && surface && surface->mapped)
+ client_set_border_color(c, urgentcolor);
+
printstatus();
}