all repos — openbox @ edd539420796233d3f69e1cceaa0f491ffdb5c6a

openbox fork - make it a bit more like ryudo

add function to focus modal children
Dana Jansens danakj@orodu.net
commit

edd539420796233d3f69e1cceaa0f491ffdb5c6a

parent

cda0b1b8b759bb14cfe57a5e0f20a83c81230035

2 files changed, 17 insertions(+), 3 deletions(-)

jump to
M src/client.ccsrc/client.cc

@@ -679,8 +679,6 @@ _transient_for->_transients.remove(this); // remove from old parent

_transient_for = c; if (_transient_for) _transient_for->_transients.push_back(this); // add to new parent - - // XXX: change decor status? } }

@@ -841,7 +839,6 @@ maxv = true;

} else if (state == otk::Property::atoms.net_wm_state_maximized_horz) { if (_max_horz) continue; maxh = true; - // XXX: resize the window etc } else if (state == otk::Property::atoms.net_wm_state_shaded) { shadestate = true; } else if (state == otk::Property::atoms.net_wm_state_skip_taskbar) {

@@ -1551,6 +1548,13 @@ setupDecorAndFunctions();

} +bool Client::focusModalChild() +{ + // XXX: find a modal child recursively and try focus it + return false; +} + + bool Client::focus() { // won't try focus if the client doesn't want it, or if the window isn't

@@ -1558,6 +1562,10 @@ // visible on the screen

if (!(frame->isVisible() && (_can_focus || _focus_notify))) return false; if (_focused) return true; + + if (_modal) + if (focusModalChild()) + return true; // do a check to see if the window has already been unmapped or destroyed // do this intelligently while watching out for unmaps we've generated
M src/client.hhsrc/client.hh

@@ -472,6 +472,12 @@ */

void internal_resize(Corner anchor, int w, int h, bool user = true, int x = INT_MIN, int y = INT_MIN); + //! Attempts to focus a modal child of this window, recursively. + /*! + @return true if a modal child has been found and focused; otherwise, false. + */ + bool focusModalChild(); + public: #ifndef SWIG //! Constructs a new Client object around a specified window id