X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FXAtom.cc;h=f6d0be730f82a5e0deda8b3be4b16ab80b4b5bbc;hb=e8b6f65186587ac8e79fcc81d8006ea1270a02d4;hp=2f560995a5e73c7e7c110dccf7c3cde40eed7844;hpb=25f3456b5db01c1383d7778382ece0e73bf66d55;p=chaz%2Fopenbox diff --git a/src/XAtom.cc b/src/XAtom.cc index 2f560995..f6d0be73 100644 --- a/src/XAtom.cc +++ b/src/XAtom.cc @@ -52,6 +52,7 @@ XAtom::XAtom(Display *d) { _atoms[wm_take_focus] = create("WM_TAKE_FOCUS"); _atoms[wm_name] = create("WM_NAME"); _atoms[wm_icon_name] = create("WM_ICON_NAME"); + _atoms[wm_class] = create("WM_CLASS"); _atoms[motif_wm_hints] = create("_MOTIF_WM_HINTS"); _atoms[blackbox_hints] = create("_BLACKBOX_HINTS"); _atoms[blackbox_attributes] = create("_BLACKBOX_ATTRIBUTES"); @@ -304,7 +305,7 @@ void XAtom::setValue(Window win, Atoms atom, StringType type, switch (type) { case ansi: t = _atoms[string]; break; case utf8: t = _atoms[utf8_string]; break; - default: assert(False); // unhandled StringType + default: assert(False); return; // unhandled StringType } setValue(win, _atoms[atom], t, reinterpret_cast(const_cast(value.c_str())), @@ -454,7 +455,7 @@ bool XAtom::getValue(Window win, Atoms atom, StringType type, switch (type) { case ansi: t = _atoms[string]; break; case utf8: t = _atoms[utf8_string]; break; - default: assert(False); return; // unhandled StringType + default: assert(False); return False; // unhandled StringType } unsigned char *value; @@ -471,10 +472,10 @@ bool XAtom::getValue(Window win, Atoms atom, StringType type, std::string::const_iterator tmp = it; // current string.begin() it = std::find(tmp, end, '\0'); // look for null between tmp and end strings.push_back(std::string(tmp, it)); // s[tmp:it) + ++num; if (it == end) break; ++it; if (it == end) break; - ++num; } nelements = num;