X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fwindow.cc;h=ba952073942b23ae77e3c6ec48bd0f3b7e51e8dd;hb=d06cedce062da73393a585d061b19b6604bbe568;hp=0d33a2f6d641487409bd5621e5e9039a9b6eb391;hpb=0adf54b0ca8f723dd25645d414b48a9a74e115d6;p=chaz%2Fopenbox diff --git a/util/epist/window.cc b/util/epist/window.cc index 0d33a2f6..ba952073 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -44,7 +44,8 @@ XWindow::XWindow(epist *epist, screen *screen, Window window) XSelectInput(_epist->getXDisplay(), _window, PropertyChangeMask | StructureNotifyMask); - updateHints(); + updateNormalHints(); + updateWMHints(); updateDimentions(); updateState(); updateDesktop(); @@ -77,7 +78,7 @@ void XWindow::updateDimentions() { } -void XWindow::updateHints() { +void XWindow::updateNormalHints() { XSizeHints size; long ret; @@ -101,6 +102,19 @@ void XWindow::updateHints() { } +void XWindow::updateWMHints() { + XWMHints *hints; + + if ((hints = XGetWMHints(_epist->getXDisplay(), _window)) != NULL) { + _can_focus = hints->input; + XFree(hints); + } else { + // assume a window takes input if it doesnt specify + _can_focus = True; + } +} + + void XWindow::updateState() { // set the defaults _shaded = _iconic = _max_vert = _max_horz = false; @@ -170,7 +184,9 @@ void XWindow::processEvent(const XEvent &e) { break; case PropertyNotify: if (e.xproperty.atom == XA_WM_NORMAL_HINTS) - updateHints(); + updateNormalHints(); + if (e.xproperty.atom == XA_WM_HINTS) + updateWMHints(); else if (e.xproperty.atom == _xatom->getAtom(XAtom::net_wm_state)) updateState(); else if (e.xproperty.atom == _xatom->getAtom(XAtom::net_wm_desktop))