diff options
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r-- | src/Workspace.cc | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc index 33818ad..da6d9c1 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Workspace.cc,v 1.94 2004/03/15 23:36:13 rathnor Exp $ | 25 | // $Id: Workspace.cc,v 1.95 2004/03/21 09:00:25 rathnor Exp $ |
26 | 26 | ||
27 | #include "Workspace.hh" | 27 | #include "Workspace.hh" |
28 | 28 | ||
@@ -167,8 +167,11 @@ void Workspace::addWindow(FluxboxWindow &w, bool place) { | |||
167 | 167 | ||
168 | } | 168 | } |
169 | 169 | ||
170 | 170 | // still_alive is true if the window will continue to exist after | |
171 | int Workspace::removeWindow(FluxboxWindow *w) { | 171 | // this event. Particularly, this isn't the removeWindow for |
172 | // the destruction of the window. Because if so, the focus revert | ||
173 | // is done in another place | ||
174 | int Workspace::removeWindow(FluxboxWindow *w, bool still_alive) { | ||
172 | 175 | ||
173 | if (w == 0) | 176 | if (w == 0) |
174 | return -1; | 177 | return -1; |
@@ -180,27 +183,8 @@ int Workspace::removeWindow(FluxboxWindow *w) { | |||
180 | m_lastfocus = 0; | 183 | m_lastfocus = 0; |
181 | } | 184 | } |
182 | 185 | ||
183 | if (w->isFocused()) { | 186 | if (w->isFocused() && still_alive) |
184 | if (screen().isSloppyFocus()) { | 187 | Fluxbox::instance()->unfocusWindow(w->winClient(), true, true); |
185 | Fluxbox::instance()->revertFocus(screen()); | ||
186 | } else { | ||
187 | // go up the transient tree looking for a focusable window | ||
188 | WinClient *client = 0; | ||
189 | if (w->numClients() > 0) { | ||
190 | client = w->winClient().transientFor(); | ||
191 | while (client) { | ||
192 | if (client->fbwindow() && | ||
193 | client->fbwindow() != w && // can't be this window | ||
194 | client->fbwindow()->isVisible() && | ||
195 | client->fbwindow()->setCurrentClient(*client, true)) | ||
196 | break; | ||
197 | client = client->transientFor(); | ||
198 | } | ||
199 | } | ||
200 | if (client == 0) // we were unsuccessful | ||
201 | Fluxbox::instance()->revertFocus(screen()); | ||
202 | } | ||
203 | } | ||
204 | 188 | ||
205 | // we don't remove it from the layermanager, as it may be being moved | 189 | // we don't remove it from the layermanager, as it may be being moved |
206 | Windows::iterator erase_it = remove(m_windowlist.begin(), | 190 | Windows::iterator erase_it = remove(m_windowlist.begin(), |