diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-07-24 17:49:57 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-07-24 17:49:57 +0000 |
| commit | fa34ea5250511e37180ea2ddd85919516f25248d (patch) | |
| tree | 3a12d927687ac0454b0e851e746a67815f8267bb /util/epist/window.cc | |
| parent | 49c04eaf57fc20efe95c431b78b2c08d6403dee2 (diff) | |
don't try pass focus off to windows that dont take it
Diffstat (limited to 'util/epist/window.cc')
| -rw-r--r-- | util/epist/window.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/util/epist/window.cc b/util/epist/window.cc index 0d33a2f6..69532272 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)) @@ -219,6 +235,7 @@ void XWindow::iconify() const { void XWindow::focus() const { + cout << "Focusing window: 0x" << hex << _window << dec << endl; // this will cause the window to be uniconified also _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window, _window); |
