XSelectInput(_epist->getXDisplay(), _window,
PropertyChangeMask | StructureNotifyMask);
- updateHints();
+ updateNormalHints();
+ updateWMHints();
updateDimentions();
updateState();
updateDesktop();
}
-void XWindow::updateHints() {
+void XWindow::updateNormalHints() {
XSizeHints size;
long ret;
}
+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;
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))
void XWindow::focus() const {
- // this will also unshade the window..
+ // this will cause the window to be uniconified also
_xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window,
_window);
+
+ //XSetInputFocus(_epist->getXDisplay(), _window, None, CurrentTime);
}