fix passing of focus when grouping
rathnor rathnor
2 files changed,
16 insertions(+),
1 deletions(-)
M
src/Window.cc
→
src/Window.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.269 2004/03/03 12:29:31 rathnor Exp $ +// $Id: Window.cc,v 1.270 2004/03/08 12:20:31 rathnor Exp $ #include "Window.hh"@@ -601,6 +601,8 @@
// reparent client win to this frame frame().setClientWindow(client); FbTk::EventManager &evm = *FbTk::EventManager::instance(); + WinClient *was_focused = 0; + WinClient *focused_win = Fluxbox::instance()->getFocusedWindow(); // get the current window on the end of our client list Window leftwin = None;@@ -621,6 +623,9 @@ evm.add(*this, (*client_it)->window());
// reparent window to this frame().setClientWindow(**client_it); + if ((*client_it) == focused_win) + was_focused = focused_win; + moveResizeClient(**client_it, frame().clientArea().x(), frame().clientArea().y(),@@ -678,6 +683,8 @@ FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(client));
btn->setOnClick(set_client_cmd); evm.add(*this, btn->window()); // we take care of button events for this + if (&client == focused_win) + was_focused = focused_win; client.m_win = this; client.saveBlackboxAttribs(m_blackbox_attrib);@@ -690,6 +697,12 @@ // affected clients if possible
m_statesig.notify(); m_workspacesig.notify(); m_layersig.notify(); + + if (was_focused != 0) { + // already has focus, we're just assuming the state of the old window + setCurrentClient(*was_focused, false); + frame().setFocus(true); + } frame().reconfigure();