From 619a0bfe958d5016364cb4bb89b0c130eb57991b Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 6 Jul 2012 02:32:58 -0400 Subject: [PATCH] convert bar_urgent to XCB --- spectrwm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spectrwm.c b/spectrwm.c index d63e6e8..1f88aa2 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1502,10 +1502,11 @@ int urgent[SWM_WS_MAX]; void bar_urgent(char *s, size_t sz) { - XWMHints *wmh = NULL; struct ws_win *win; int i, j, num_screens; char b[8]; + xcb_get_property_cookie_t c; + xcb_wm_hints_t hints; for (i = 0; i < workspace_limit; i++) urgent[i] = 0; @@ -1514,13 +1515,12 @@ bar_urgent(char *s, size_t sz) for (i = 0; i < num_screens; i++) for (j = 0; j < workspace_limit; j++) TAILQ_FOREACH(win, &screens[i].ws[j].winlist, entry) { - wmh = XGetWMHints(display, win->id); - if (wmh == NULL) + c = xcb_get_wm_hints(conn, win->id); + if (xcb_get_wm_hints_reply(conn, c, + &hints, NULL) == 0) continue; - - if (wmh->flags & XUrgencyHint) + if (hints.flags & XCB_WM_HINT_X_URGENCY) urgent[j] = 1; - XFree(wmh); } for (i = 0; i < workspace_limit; i++) { -- 1.7.10.4