summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-03 08:47:57 +0000
committerDana Jansens <danakj@orodu.net>2003-02-03 08:47:57 +0000
commitedd539420796233d3f69e1cceaa0f491ffdb5c6a (patch)
treec01b844c0581288beeaeccfc2d872f76ec5d96ba /src
parentcda0b1b8b759bb14cfe57a5e0f20a83c81230035 (diff)
add function to focus modal children
Diffstat (limited to 'src')
-rw-r--r--src/client.cc14
-rw-r--r--src/client.hh6
2 files changed, 17 insertions, 3 deletions
diff --git a/src/client.cc b/src/client.cc
index 08feae3e..83ee5b9a 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -679,8 +679,6 @@ void Client::updateTransientFor()
_transient_for = c;
if (_transient_for)
_transient_for->_transients.push_back(this); // add to new parent
-
- // XXX: change decor status?
}
}
@@ -841,7 +839,6 @@ void Client::setState(StateAction action, long data1, long data2)
} 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 @@ void Client::disableDecorations(DecorationFlags flags)
}
+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
@@ -1559,6 +1563,10 @@ bool Client::focus()
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
// (ignore_unmaps > 0)
diff --git a/src/client.hh b/src/client.hh
index e66712c4..d3e3a9b0 100644
--- a/src/client.hh
+++ b/src/client.hh
@@ -472,6 +472,12 @@ private:
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