Merge patch by @garin in #29

This commit is contained in:
Takashi Kokubun 2018-06-23 21:42:50 +09:00
parent 34cbeea0a0
commit 7a2ec961f3

View File

@ -18,6 +18,12 @@ mrb_xw_fetch_window_class(mrb_state *mrb, mrb_value self)
XTextProperty prop;
// XGetTextProperty can return 0 when xmonad's workspace is selected, while it usually returns 1.
// This prevents SEGV in such a situation.
if (XGetTextProperty(display, window, &prop, net_wm_name) == 0) {
return display_obj;
}
while (1) {
if (XGetTextProperty(display, window, &prop, net_wm_name)) { break; }