From 10f769f7fc1766a647a063f4204d7c5b0b0e45ba Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 23 Aug 2008 06:34:06 -0700 Subject: when a transient dies, revert focus to its parent --- src/FocusControl.cc | 8 ++++---- src/WinClient.cc | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/FocusControl.cc b/src/FocusControl.cc index cdc46cf..60615a4 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -505,13 +505,13 @@ void FocusControl::unfocusWindow(WinClient &client, BScreen &screen = fbwin->screen(); + if (client.isTransient() && client.transientFor()->focus()) + return; + if (!unfocus_frame) { WinClient *last_focus = screen.focusControl().lastFocusedWindow(*fbwin, &client); - if (last_focus != 0 && - fbwin->setCurrentClient(*last_focus, - s_focused_window == &client)) { + if (last_focus && last_focus->focus()) return; - } } if (full_revert && s_focused_window == &client) diff --git a/src/WinClient.cc b/src/WinClient.cc index bded700..aa8c6ed 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -126,7 +126,6 @@ WinClient::~WinClient() { transient_for->transientList().remove(this); if (m_modal) transient_for->removeModal(); - transient_for = 0; } while (!transients.empty()) { @@ -141,13 +140,13 @@ WinClient::~WinClient() { // this takes care of any focus issues m_diesig.notify(); - Fluxbox *fluxbox = Fluxbox::instance(); - // This fixes issue 1 (see WinClient.hh): // If transients die before the transient_for is created + transient_for = 0; removeTransientFromWaitingList(); s_transient_wait.erase(window()); + Fluxbox *fluxbox = Fluxbox::instance(); if (window_group != 0) { fluxbox->removeGroupSearch(window_group); -- cgit v0.11.2