commit 795ea1f

Michael Forney  ·  2014-04-26 18:07:20 +0000 UTC
parent e65cced
xwm: Handle get_wm_name failure
1 files changed,  +9, -5
+9, -5
 1@@ -83,13 +83,17 @@ static void update_name(struct xwl_window * xwl_window)
 2     xcb_ewmh_get_utf8_strings_reply_t wm_name_reply;
 3 
 4     wm_name_cookie = xcb_ewmh_get_wm_name(&xwm.ewmh, xwl_window->id);
 5-    xcb_ewmh_get_wm_name_reply(&xwm.ewmh, wm_name_cookie,
 6-                               &wm_name_reply, NULL);
 7 
 8-    window_set_title(&xwl_window->window,
 9-                     wm_name_reply.strings, wm_name_reply.strings_len);
10+    if (xcb_ewmh_get_wm_name_reply(&xwm.ewmh, wm_name_cookie,
11+                                   &wm_name_reply, NULL))
12+    {
13+        window_set_title(&xwl_window->window,
14+                         wm_name_reply.strings, wm_name_reply.strings_len);
15 
16-    xcb_ewmh_get_utf8_strings_reply_wipe(&wm_name_reply);
17+        xcb_ewmh_get_utf8_strings_reply_wipe(&wm_name_reply);
18+    }
19+    else
20+        window_set_title(&xwl_window->window, NULL, 0);
21 }
22 
23 static struct xwl_window * find_window(struct wl_list * list, xcb_window_t id)